public static <E> E findLast(Iterator<E> iterator, Predicate<E> predicate) {
        final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
        return new LastElement<E>().apply(filtered);
    }
public static < E > E findLast ( Iterator < E > iterator , Predicate < E > predicate ) { final Iterator < E > filtered = new FilteringIterator < E > ( iterator , predicate ) ; return new LastElement < E > ( ) . apply ( filtered ) ; }
Searches the last matching element returning it.

@param <E> the element type parameter
@param iterator the iterator to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if no element matches
@return the last element found