code: 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;
    }
docs: Returns {@code true} if {@code iterator} contains {@code element}.