void () { JBTreeTraverser<Integer> t = numTraverser(); class F extends JBIterable.SCond<Integer> { int count; final boolean value; F(boolean initialVal) { value = initialVal; } @Override public boolean value(Integer integer) { return count ++ > 0 == value; } } JBIterable<Integer> it = t.regard(new F(true)).traverse(); assertEquals(Arrays.asList(1, 5, 6, 7, 3, 9, 10, 4, 12, 13), it.toList()); assertEquals(Arrays.asList(1, 5, 6, 7, 3, 9, 10, 4, 12, 13), it.toList()); assertEquals(it.toList(), t.forceDisregard(new F(false)).reset().toList()); }