code: public static int advance(Iterator<?> iterator, int numberToAdvance) {
      checkNotNull(iterator);
      checkArgument(numberToAdvance >= 0, "numberToAdvance must be nonnegative");
  
      int i;
      for (i = 0; i < numberToAdvance && iterator.hasNext(); i++) {
        iterator.next();
      }
      return i;
    }
docs: Calls {@code next()} on {@code iterator}, either {@code numberToAdvance} times
  or until {@code hasNext()} returns {@code false}, whichever comes first.
  
  @return the number of elements the iterator was advanced
  @since 13.0 (since 3.0 as {@code Iterators.skip})