use of org.eclipse.collections.api.block.function.Function0 in project eclipse-collections by eclipse.
the class SerialParallelLazyPerformanceTest method getIntegerListGenerators.
private MutableList<Function0<FastList<Integer>>> getIntegerListGenerators(int count, boolean shuffle) {
Interval interval = Interval.fromTo(-(count / 2), count / 2 - 1);
MutableList<Function0<FastList<Integer>>> generators = FastList.newList();
generators.add(() -> {
FastList<Integer> integers = FastList.newList(interval);
if (shuffle) {
integers.shuffleThis();
}
return integers;
});
return generators.shuffleThis();
}
use of org.eclipse.collections.api.block.function.Function0 in project eclipse-collections by eclipse.
the class SerialParallelPerformanceTest method getIntegerListGenerators.
private MutableList<Function0<Iterable<Integer>>> getIntegerListGenerators(int count) {
Interval interval = Interval.fromTo(-(count / 2), count / 2 - 1);
MutableList<Function0<Iterable<Integer>>> generators = FastList.newList();
generators.add(() -> interval.toList().shuffleThis());
generators.add(() -> {
MutableList<Integer> integers = interval.toList().shuffleThis();
return integers.toImmutable();
});
generators.add(interval::toSet);
return generators.shuffleThis();
}
Aggregations