public Instance next() { Instance input = source.peekNext(); for (int i = 0; i < pipes.size(); i++) { if (pipes.get(i).precondition(input)) { return iterators.get(i).next(); } } throw new IllegalStateException( "Next Instance satisfied none of the branches' preconditions."); }
public boolean hasNext() { return source.hasNext() && testingPipe.precondition(source.peekNext()); }
public Instance next() { // Make sure this is not an Instance we were supposed to skip. assert (testingPipe.precondition(source.peekNext())); return source.next(); }