@Test(dataProvider = "lists") public void testListIterator(List<String> list) { list.add("Hi"); list.add("Ahoj"); list.add("Ciao"); Collections.sort(list); ListIterator<String> it = list.listIterator(3); assertEquals(it.previous(), "Hi"); assertEquals(it.previous(), "Ciao"); it.remove(); assertEquals(it.next(), "Hi"); assertEquals(it.previous(), "Hi"); assertEquals(it.previous(), "Ahoj"); assertEquals(list.size(), 2); }
@Override public ListIterator<E> listIterator() { return new LI(0, size); }
SimpleList implements List<E> { @Override public ListIterator<E> listIterator() { return new LI(0, size); } }
SimpleList implements List<E> { @Override public ListIterator<E> listIterator() { return new LI(0, size); } SimpleList(); private  SimpleList(Object[] data); }
SimpleList implements List<E> { @Override public ListIterator<E> listIterator() { return new LI(0, size); } SimpleList(); private  SimpleList(Object[] data); static List<T> asList(T... arr); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); @Override boolean addAll(int index, Collection<? extends E> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); void sort(Comparator<? super E> c); @Override void clear(); @Override E get(int index); @Override E set(int index, E element); @Override void add(int index, E element); @Override E remove(int index); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); int lastIndexOfImpl(Object o, int from, int to); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int index); @Override List<E> subList(int fromIndex, int toIndex); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static void ensureSize(List<?> list, int size); }
SimpleList implements List<E> { @Override public ListIterator<E> listIterator() { return new LI(0, size); } SimpleList(); private  SimpleList(Object[] data); static List<T> asList(T... arr); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); @Override boolean addAll(int index, Collection<? extends E> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); void sort(Comparator<? super E> c); @Override void clear(); @Override E get(int index); @Override E set(int index, E element); @Override void add(int index, E element); @Override E remove(int index); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); int lastIndexOfImpl(Object o, int from, int to); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int index); @Override List<E> subList(int fromIndex, int toIndex); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static void ensureSize(List<?> list, int size);  }