@NullableDecl
  static <T> T pollNext(Iterator<T> iterator) {
    if (iterator.hasNext()) {
      T result = iterator.next();
      iterator.remove();
      return result;
    } else {
      return null;
    }
  }
@NullableDecl
  static <T> T pollNext(Iterator<T> iterator) {
    if (iterator.hasNext()) {
      T result = iterator.next();
      iterator.remove();
      return result;
    } else {
      return null;
    }
  }
@ NullableDecl static < T > T pollNext ( Iterator < T > iterator ) { if ( iterator . hasNext ( ) ) { T result = iterator . next ( ) ; iterator . remove ( ) ; return result ; } else { return null ; } }
Deletes and returns the next value from the iterator, or returns {@code null} if there is no
such value.
Deletes and returns the next value from the iterator or returns {