get Last
Returns the last element of this or defaultValue if the iterable is empty. If this is a List with RandomAccess support, then this operation is guaranteed to be O(1).
Stream equivalent: Streams.findLast(stream).get()
Return
the last element of this or the default value
See also
Parameters
default Value
the value to return if this is empty
Throws
if the iterable is empty and the default value is null
Advances this to the end, returning the last element or defaultValue if the iterator is empty and defaultValue is not null.
Return
the last element of this
See also
Throws
if the iterator is empty and defaultValue is null.