@Override
protected List<LongIntListMap> createMapsFromLists(LongList keys, IntList values) {
IntArray indices = new IntArray(IntProgression.range(keys.size()));
indices.shuffle(myRand);
LongIntListMap createdMap = new LongIntListMap();
for (LongIntIterator it : LongIntIterators.pair(keys.get(indices), values.get(indices))) {
createdMap.add(it.left(), it.right());
}
final LongArray keys0 = new LongArray(keys);
final IntArray values0 = new IntArray(values);
IntegersUtils.quicksort(keys.size(), LongFunctions.comparator(keys0),
new IntIntProcedure() {
@Override
public void invoke(int a, int b) {
keys0.swap(a, b);
values0.swap(a, b);
}
});
return Arrays.asList(new LongIntListMap(keys0, values0), createdMap);
}