android/guava/src/com/google/common/collect/Iterators.java
public static boolean contains(Iterator<?> iterator, @NullableDecl Object element) {
    if (element == null) {
      while (iterator.hasNext()) {
        if (iterator.next() == null) {
          return true;
        }
      }
    } else {
      while (iterator.hasNext()) {
        if (element.equals(iterator.next())) {
          return true;
        }
      }
    }
    return false;
  }
public static boolean contains(Iterator<?> iterator, @NullableDecl Object element) {
    if (element == null) {
      while (iterator.hasNext()) {
        if (iterator.next() == null) {
          return true;
        }
      }
    } else {
      while (iterator.hasNext()) {
        if (element.equals(iterator.next())) {
          return true;
        }
      }
    }
    return false;
  }
Returns {@code true} if {@code iterator} contains {@code element}.