List of usage examples for java.util Iterator forEachRemaining
default void forEachRemaining(Consumer<? super E> action)
From source file:peapod.FramedGraph.java
public <F, E extends Element> List<F> frame(Iterator<E> it, Class<F> clazz) { List<F> result = new ArrayList<>(); it.forEachRemaining(e -> { IFramer<E, F> framer = registry.get(e, clazz); result.add(framer.frame(e, this)); });// w w w .j a v a2 s .com return Collections.unmodifiableList(result); }