class CheckedIterator {

    @Nullable
    public E getLast() throws T, NoSuchElementException {
        while (true) {
            E current = next();
            if (!hasNext()) {
                return current;
            }
        }
    }

}