Correct behaviour of this method relied on the broken behaviour of "shuffle".
With a fixed "shuffle", the "nextSample()" unit test caught the bug in this method.
"shuffle" method broken (in class "o.a.c.m.random.RandomDataGenerator")
IIUC, the whole array must be randomized (which is what the broken "shuffle" was doing), then from the "n" entries, "k" are picked (see attached patch).
Proposed fix committed in revision 1512306.
"Affects Version" entry set to empty to indicate that the bug does not affect applications.