@NullableDecl
  public static <T> T getLast(Iterator<? extends T> iterator, @NullableDecl T defaultValue) {
    return iterator.hasNext() ? getLast(iterator) : defaultValue;
  }
@NullableDecl
  public static <T> T getLast(Iterator<? extends T> iterator, @NullableDecl T defaultValue) {
    return iterator.hasNext() ? getLast(iterator) : defaultValue;
  }
@ NullableDecl public static < T > T getLast ( Iterator < ? extends T > iterator , @ NullableDecl T defaultValue ) { return iterator . hasNext ( ) ? getLast ( iterator ) : defaultValue ; }
Advances {@code iterator} to the end, returning the last element or {@code defaultValue} if the
iterator is empty.

@param defaultValue the default value to return if the iterator is empty
@return the last element of {@code iterator}
@since 3.0
Advances { @code iterator } to the end returning the last element or { @code defaultValue } if the iterator is empty .