@Test public void testListIterator() { final List<Item> list = new ArrayList<>(); EnablementListView view = new EnablementListView() { @Override protected ViewType getViewType() { return null; } @Override protected Extension getExtension() { return null; } @Override protected List<Item> getDelegate() { return list; } }; int stringPriority = 20; list.add(new Item(Integer.class, 10)); list.add(new Item(String.class, stringPriority)); list.add(new Item(Double.class, 30)); ListIterator<Class<?>> iterator = view.listIterator(); assertEquals(Integer.class, iterator.next()); iterator.remove(); iterator.add(Float.class); assertEquals(Float.class, iterator.previous()); assertFalse(iterator.hasPrevious()); assertTrue(iterator.hasNext()); assertEquals(Float.class, iterator.next()); assertEquals(String.class, iterator.next()); iterator.set(StringBuilder.class); assertEquals(3, list.size()); assertEquals(StringBuilder.class, view.get(1)); assertEquals(stringPriority, list.get(1).getPriority()); }
@Override public ListIterator<Class<?>> listIterator() { return new EnablementListViewIterator(getDelegate().listIterator()); }
EnablementListView extends ListView<Item, Class<?>> { @Override public ListIterator<Class<?>> listIterator() { return new EnablementListViewIterator(getDelegate().listIterator()); } }
EnablementListView extends ListView<Item, Class<?>> { @Override public ListIterator<Class<?>> listIterator() { return new EnablementListViewIterator(getDelegate().listIterator()); }  }
EnablementListView extends ListView<Item, Class<?>> { @Override public ListIterator<Class<?>> listIterator() { return new EnablementListViewIterator(getDelegate().listIterator()); }  @Override boolean add(Class<?> element); @Override Class<?> set(int index, Class<?> element); @Override void add(int index, Class<?> element); @Override Class<?> remove(int index); @Override boolean removeAll(Collection<?> c); @Override boolean remove(Object o); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Override ListIterator<Class<?>> listIterator(); @Override ListIterator<Class<?>> listIterator(int index); @Override /** * Override contains to support Object -> Item conversion */ boolean contains(Object o); @Override int indexOf(Object o); }
EnablementListView extends ListView<Item, Class<?>> { @Override public ListIterator<Class<?>> listIterator() { return new EnablementListViewIterator(getDelegate().listIterator()); }  @Override boolean add(Class<?> element); @Override Class<?> set(int index, Class<?> element); @Override void add(int index, Class<?> element); @Override Class<?> remove(int index); @Override boolean removeAll(Collection<?> c); @Override boolean remove(Object o); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Override ListIterator<Class<?>> listIterator(); @Override ListIterator<Class<?>> listIterator(int index); @Override /** * Override contains to support Object -> Item conversion */ boolean contains(Object o); @Override int indexOf(Object o);  }