DoubleLinkedList { public int lastIndexOf(Object o) { int index = size; if (o == null) { for (Entry e = header.previous; e != header; e = e.previous) { index--; if (e.element == null) return index; } } else { for (Entry e = header.previous; e != header; e = e.previous) { index--; if (o == e.element) return index; } } return -1; } 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 public void testLastIndexOf() { DoubleLinkedList dll = new DoubleLinkedList(); dll.add(0); Assert.assertEquals(0, dll.lastIndexOf(0)); }