public void testCollectionsParallization() {
// Repeat the last test a number of times
for (int c = 0; c < 100; c++) {
final List<String> linked = new LinkedList<String>(Arrays.asList(Data.sn));
final CoreObject<String> x = $(linked);
final CoreNumber as = x.map(new F1<String, Integer>() {
@Override
public Integer f(String xx) {
return $(xx).I(0);
}
}).as(CoreNumber.class);
Assert.assertEquals(Data.sn.length, as.size());
Assert.assertEquals(Data.sn.length, as.compact().size());
final long i = Data.sn.length - 1;
Assert.assertEquals(i * (i + 1) / 2, (long) as.sum());
}
}