Iterator<T> () { final Iterator<T> source = sourceIterable.iterator(); return new AbstractIterator<T>() { @Override protected T computeNext() { while(true) { if (source.hasNext()) { T element = source.next(); if (!predicate.apply(element)) { continue; } return element; } return this.endOfData(); } } }; }