/** Are there any more acceptable objects. * @return true if there is another acceptable object. */ @Override synchronized public boolean hasNext() { if (current!=null) return true; while ( underlying.hasNext() ) { current = f.accept( underlying.next() ); if (current != null) return true; } current = null; dead = true; return false; }