android/guava/src/com/google/common/collect/Iterators.java
public static <T> Optional<T> tryFind(Iterator<T> iterator, Predicate<? super T> predicate) {
    checkNotNull(iterator);
    checkNotNull(predicate);
    while (iterator.hasNext()) {
      T t = iterator.next();
      if (predicate.apply(t)) {
        return Optional.of(t);
      }
    }
    return Optional.absent();
  }
public static <T> Optional<T> tryFind(Iterator<T> iterator, Predicate<? super T> predicate) {
    checkNotNull(iterator);
    checkNotNull(predicate);
    while (iterator.hasNext()) {
      T t = iterator.next();
      if (predicate.apply(t)) {
        return Optional.of(t);
      }
    }
    return Optional.absent();
  }
Returns an {@link Optional} containing the first element in {@code iterator} that satisfies the
given predicate, if such an element exists. If no such element is found, an empty {@link
Optional} will be returned from this method and the iterator will be left exhausted: its {@code
hasNext()} method will return {@code false}.

<p><b>Warning:</b> avoid using a {@code predicate} that matches {@code null}. If {@code null}
is matched in {@code iterator}, a NullPointerException will be thrown.

@since 11.0