public void addLast(Item item) {
        if (item == null)
            throw new NullPointerException();
        if (isEmpty())
            addFirst(item);
        else {
            Node<Item> node = new Node<Item>();
            node.item = item;
            node.prev = last;
            last.next = node;
            node.next = null;
            last = node;
            size++;
        }
    }