public Item removeLast() {
        if (isEmpty())
            throw new java.util.NoSuchElementException();
        else if (size() == 1)
            return removeFirst();
        Item item = last.item;
        last = last.prev;
        last.next = null;
        size--;
        return item;
    }