public void clear() {
        Node<T> node = head.next, next;
        size = 0;
        head.reset(); // Clearing references.
        tail = head;
        iterator.currentNode = head;
        while (node != null) {
            next = node.next;
            node.free(pool);
            node = next;
        }
    }
public void clear ( ) { Node < T > node = head . next , next ; size = 0 ; head . reset ( ) ; tail = head ; iterator . currentNode = head ; while ( node != null ) { next = node . next ; node . free ( pool ) ; node = next ; } }
Removes all elements of the list. Frees all nodes to the pool.