public T nextInSequence ( ) { T result = null ; // Loop until a filtered element is found, or the source iterator is exhausted. while ( source . hasNext ( ) ) { S next = source . next ( ) ; result = mapping . apply ( next ) ; if ( result != null ) { break ; } } return result ; }
Generates the next element in the sequence .