@Test public void testRemoveFirst() { this.list.add( this.node1 ); this.list.add( this.node2 ); this.list.add( this.node3 ); assertSame( "List should return node1 on getFirst()", this.list.getFirst(), this.node1 ); this.list.removeFirst(); assertSame( "List should return node2 on getFirst()", this.list.getFirst(), this.node2 ); this.list.removeFirst(); assertSame( "List should return node3 on getFirst()", this.list.getFirst(), this.node3 ); this.list.removeFirst(); assertNull( "Empty list should return null on getFirst()", this.list.getFirst() ); }
public T removeFirst() { if ( this.firstNode == null ) { return null; } final T node = this.firstNode; this.firstNode = node.getNext(); node.setNext( null ); if ( this.firstNode != null ) { this.firstNode.setPrevious( null ); } else { this.lastNode = null; } this.size--; return node; }
LinkedList implements
    Externalizable { public T removeFirst() { if ( this.firstNode == null ) { return null; } final T node = this.firstNode; this.firstNode = node.getNext(); node.setNext( null ); if ( this.firstNode != null ) { this.firstNode.setPrevious( null ); } else { this.lastNode = null; } this.size--; return node; } }
LinkedList implements
    Externalizable { public T removeFirst() { if ( this.firstNode == null ) { return null; } final T node = this.firstNode; this.firstNode = node.getNext(); node.setNext( null ); if ( this.firstNode != null ) { this.firstNode.setPrevious( null ); } else { this.lastNode = null; } this.size--; return node; } LinkedList();  LinkedList(final T node); }
LinkedList implements
    Externalizable { public T removeFirst() { if ( this.firstNode == null ) { return null; } final T node = this.firstNode; this.firstNode = node.getNext(); node.setNext( null ); if ( this.firstNode != null ) { this.firstNode.setPrevious( null ); } else { this.lastNode = null; } this.size--; return node; } 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 T removeFirst() { if ( this.firstNode == null ) { return null; } final T node = this.firstNode; this.firstNode = node.getNext(); node.setNext( null ); if ( this.firstNode != null ) { this.firstNode.setPrevious( null ); } else { this.lastNode = null; } this.size--; return node; } 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; }