@Test public void testAdd() { this.list.add( this.node1 ); assertNull( "Node1 previous should be null", this.node1.getPrevious() ); assertNull( "Node1 next should be null", this.node1.getNext() ); assertSame( "First node should be node1", this.list.getFirst(), this.node1 ); assertSame( "Last node should be node1", this.list.getLast(), this.node1 ); this.list.add( this.node2 ); assertSame( "node1 next should be node2", this.node1.getNext(), this.node2 ); assertSame( "node2 previous should be node1", this.node2.getPrevious(), this.node1 ); assertSame( "First node should be node1", this.list.getFirst(), this.node1 ); assertSame( "Last node should be node2", this.list.getLast(), this.node2 ); this.list.add( this.node3 ); assertSame( "node2 next should be node3", this.node2.getNext(), this.node3 ); assertSame( "node3 previous should be node2", this.node3.getPrevious(), this.node2 ); assertEquals( "LinkedList should have 3 nodes", this.list.size(), 3 ); assertSame( "First node should be node1", this.list.getFirst(), this.node1 ); assertSame( "Last node should be node3", this.list.getLast(), this.node3 ); }
public void add(final T node) { if ( this.firstNode == null ) { this.firstNode = node; this.lastNode = node; } else { this.lastNode.setNext( node ); node.setPrevious( this.lastNode ); this.lastNode = node; } this.size++; }
LinkedList implements
    Externalizable { public void add(final T node) { if ( this.firstNode == null ) { this.firstNode = node; this.lastNode = node; } else { this.lastNode.setNext( node ); node.setPrevious( this.lastNode ); this.lastNode = node; } this.size++; } }
LinkedList implements
    Externalizable { public void add(final T node) { if ( this.firstNode == null ) { this.firstNode = node; this.lastNode = node; } else { this.lastNode.setNext( node ); node.setPrevious( this.lastNode ); this.lastNode = node; } this.size++; } LinkedList();  LinkedList(final T node); }
LinkedList implements
    Externalizable { public void add(final T node) { if ( this.firstNode == null ) { this.firstNode = node; this.lastNode = node; } else { this.lastNode.setNext( node ); node.setPrevious( this.lastNode ); this.lastNode = node; } this.size++; } 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(); }
LinkedList implements
    Externalizable { public void add(final T node) { if ( this.firstNode == null ) { this.firstNode = node; this.lastNode = node; } else { this.lastNode.setNext( node ); node.setPrevious( this.lastNode ); this.lastNode = node; } this.size++; } 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; }