code: public static <E> E findOne(Iterator<E> iterator, Predicate<E> predicate) {
          final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate);
          return new OneElement<E>().apply(filtered);
      }
docs: Searches the only 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 IllegalStateException if more than one element is found
  @throws IllegalArgumentException if no element matches
  @return the found element