public void clear() {
        //Remove all references in the list.
        LinkedListNode<E> node = getLast();
        while (node != null) {
            node.remove();
            node = getLast();
        }

        //Re-initialize.
        head.next = head.previous = head;
    }
Erases all elements in the list and re-initializes it.
xmppserver/src/main/java/org/jivesoftware/util/LinkedList.java