code: public static <T> boolean all(Iterator<T> iterator, Predicate<? super T> predicate) {
      checkNotNull(predicate);
      while (iterator.hasNext()) {
        T element = iterator.next();
        if (!predicate.apply(element)) {
          return false;
        }
      }
      return true;
    }
docs: Returns {@code true} if every element returned by {@code iterator} satisfies the given
  predicate. If {@code iterator} is empty, {@code true} is returned.