private void initHeadTail(Node<E> h, Node<E> t) {
        if (h == t) {
            if (h == null)
                h = t = new Node<E>();
            else {
                // Avoid edge case of a single Node with non-null item.
                Node<E> newNode = new Node<E>();
                NEXT.set(t, newNode);
                PREV.set(newNode, t);
                t = newNode;
            }
        }
        head = h;
        tail = t;
    }
private void initHeadTail ( Node < E > h , Node < E > t ) { if ( h == t ) { if ( h == null ) h = t = new Node < E > ( ) ; else { Node < E > newNode = new Node < E > ( ) ; NEXT . set ( t , newNode ) ; PREV . set ( newNode , t ) ; t = newNode ; } } head = h ; tail = t ; }
Initializes head and tail, ensuring invariants hold.