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