code: public static long advance(Iterator<?> iterator, long numberToAdvance) {
          N.checkArgNotNegative(numberToAdvance, "numberToAdvance");
  
          long i;
  
          for (i = 0; i < numberToAdvance && iterator.hasNext(); i++) {
              iterator.next();
          }
  
          return i;
      }
docs: Note: copied from Google Guava under Apache license v2
  <br />
  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