List of usage examples for java.util Spliterator forEachRemaining
default void forEachRemaining(Consumer<? super T> action)
From source file:enumj.EnumeratorTest.java
@Test public void testAsSpliterator() { System.out.println("asSpliterator"); EnumeratorGenerator.generatorPairs().limit(100) .map(p -> Pair.of(p.getLeft().enumerator(), p.getRight().enumerator().asSpliterator())) .forEach(p -> {//from w ww. ja v a 2 s . c o m MutableLong c = new MutableLong(p.getLeft().count()); final Spliterator<Double> s = p.getRight(); s.forEachRemaining(d -> c.decrement()); assertEquals(0, c.longValue()); }); }