@SuppressWarnings("unchecked")
    public final T last() {
        if (this instanceof Callable) {
            return checkedCall((Callable<T>) this);
        }
        Iterator<T> it = iterator();
        if (!it.hasNext()) {
            throw new NoSuchElementException();
        }

        for (;;) {
            T t = it.next();
            if (!it.hasNext()) {
                return t;
            }
        }
    }
@ SuppressWarnings ( "unchecked" ) public final T last ( ) { if ( this instanceof Callable ) { return checkedCall ( ( Callable < T > ) this ) ; } Iterator < T > it = iterator ( ) ; if ( ! it . hasNext ( ) ) { throw new NoSuchElementException ( ) ; } for ( ; ; ) { T t = it . next ( ) ; if ( ! it . hasNext ( ) ) { return t ; } } }
Returns the last element of this sequence.
@return the last element of this sequence
@throws NoSuchElementException if the sequence is empty
@since 1.0
@see #last(Object)