public T remove()
    {
        if ( size == 0 ) {
            return null;
        }
        
        //remove the first element
        Entry<T> o = head.next;
        head.next   = o.next;
        o.next.prev = head;
        
        //bakup the data
        T v         = o.data;
        size--;
        index.remove(v.getValue());
        
        o = null;            //Let gc do its work
        
        return v;
    }
public T remove ( ) { if ( size == 0 ) { return null ; } Entry < T > o = head . next ; head . next = o . next ; o . next . prev = head ; T v = o . data ; size -- ; index . remove ( v . getValue ( ) ) ; o = null ; return v ; }
remove the node from the head
and you should make sure the size is larger than 0 by calling size()
before you invoke the method or you will just get null.