void () { JBIterable<Integer> it = JBIterable.generate(1, INCREMENT).take(5).filter(new JBIterable.SCond<>() { int prev; @Override public boolean value(Integer integer) { boolean b = integer > prev; if (b) prev = integer; return b; } }); assertEquals(Arrays.asList(1, 2, 3, 4, 5), it.toList()); assertEquals(Arrays.asList(1, 2, 3, 4, 5), it.toList()); }