public void insertLast(E e) {
        DoublyLinkedNode n = new DoublyLinkedNode();
        n.setKey(e);
        if (head == null) {
            head = n;
            tail = n;
        } else {
            if (tail != null) {
                tail.setSucc(n);
                n.setPred(tail);
                tail = n;
            }
        }
        size++;
    }