LinkedList implements
    Externalizable { public void remove(final T node) { if ( this.firstNode == node ) { removeFirst(); } else if ( this.lastNode == node ) { removeLast(); } else { node.getPrevious().setNext( node.getNext() ); (node.getNext()).setPrevious( node.getPrevious() ); this.size--; node.setPrevious( null ); node.setNext( null ); } } LinkedList();  LinkedList(final T node); void readExternal(ObjectInput in); void writeExternal(ObjectOutput out); void add(final T node); void addLast(final T node); void addFirst(final T node); void remove(final T node); boolean contains(T node); final T getFirst(); final T getLast(); T removeFirst(); void insertAfter(final T existingNode,
                            final T newNode); T removeLast(); T get(int i); final boolean isEmpty(); void clear(); final int size(); int hashCode(); boolean equals(final Object object); FastIterator iterator(); FastIterator fastIterator(); java.util.Iterator<T> javaUtilIterator(); static final FastIterator fastIterator; }
@Test public void testRemove() { this.list.add( this.node1 ); this.list.add( this.node2 ); this.list.add( this.node3 ); assertSame( "Node2 previous should be node1", this.node2.getPrevious(), this.node1 ); assertSame( "Node2 next should be node3", this.node2.getNext(), this.node3 ); this.list.remove( this.node2 ); assertNull( "Node2 previous should be null", this.node2.getPrevious() ); assertNull( "Node2 next should be null", this.node2.getNext() ); assertNull( "Node1 previous should be null", this.node1.getPrevious() ); assertSame( "Node1 next should be node3", this.node1.getNext(), this.node3 ); this.list.remove( this.node1 ); assertNull( "Node1 previous should be null", this.node1.getPrevious() ); assertNull( "Node1 next should be null", this.node1.getNext() ); assertNull( "Node3 previous should be null", this.node3.getPrevious() ); assertNull( "Node3 next should be null", this.node3.getNext() ); this.list.remove( this.node3 ); assertNull( "Node3 previous should be null", this.node3.getPrevious() ); assertNull( "Node3 next should be null", this.node3.getNext() ); }