void () { JBIterable<Integer> it = JBIterable.generate(1, INCREMENT).take(30); assertEquals(it.toList(), it.unique().toList()); JBIterable<Integer> uniqueMod5 = it.unique((o) -> o % 5); assertEquals(Arrays.asList(1, 2, 3, 4, 5), uniqueMod5.toList()); assertEquals(Arrays.asList(1, 2, 3, 4, 5), uniqueMod5.toList()); // same results again }