DoubleLinkedList { public Object getLast() { if (size == 0) throw new NoSuchElementException(); return header.previous.element; } DoubleLinkedList();  DoubleLinkedList(Collection c); boolean test(DoubleLinkedList dll, Object o); Object getFirst(); Object getLast(); Object removeFirst(); Object removeLast(); void addFirst(Object o); void addLast(Object o); boolean contains(Object o); int size(); boolean add(Object o); boolean remove(Object o); boolean addAll(Collection c); boolean addAll(int index, Collection c); void clear(); Object get(int index); Object set(int index, Object element); void add(int index, Object element); Object remove(int index); int indexOf(Object o); int lastIndexOf(Object o); ListIterator listIterator(int index); Object clone(); Object[] toArray(); Object[] toArray(Object a[]);  }
@Test(expected=NoSuchElementException.class) public void testGetLast() { DoubleLinkedList dll = new DoubleLinkedList(); dll.add(1); dll.add(null); dll.add(2); Assert.assertEquals(null, dll.remove(1)); Assert.assertEquals(2, dll.getLast()); dll.remove(0); dll.remove(0); dll.getLast(); }