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