docs: public static <T> Iterator<T> checkHasNext(Iterator<T> iterator, String message) throws NoSuchElementException {
          if (!iterator.hasNext()) {
              throw new NoSuchElementException(message);
          }
          return iterator;
      }