@Test public void testAdd() { List<String> list = newList(); list.add("January"); list.add("February"); list.add("March"); list.add("April"); list.add("May"); list.add("June"); checkStructure(list); assertEquals(6, list.size()); assertEquals("January" , list.get(0)); assertEquals("February", list.get(1)); assertEquals("March" , list.get(2)); assertEquals("April" , list.get(3)); assertEquals("May" , list.get(4)); assertEquals("June" , list.get(5)); }
public void add(int index, E val) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException(); if (size() == Integer.MAX_VALUE) throw new IllegalStateException("Maximum size reached"); root = root.insertAt(index, val); }
AvlTreeList extends AbstractList<E> { public void add(int index, E val) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException(); if (size() == Integer.MAX_VALUE) throw new IllegalStateException("Maximum size reached"); root = root.insertAt(index, val); } }
AvlTreeList extends AbstractList<E> { public void add(int index, E val) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException(); if (size() == Integer.MAX_VALUE) throw new IllegalStateException("Maximum size reached"); root = root.insertAt(index, val); } AvlTreeList();  AvlTreeList(Collection<? extends E> coll); }
AvlTreeList extends AbstractList<E> { public void add(int index, E val) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException(); if (size() == Integer.MAX_VALUE) throw new IllegalStateException("Maximum size reached"); root = root.insertAt(index, val); } AvlTreeList();  AvlTreeList(Collection<? extends E> coll); int size(); E get(int index); E set(int index, E val); void add(int index, E val); E remove(int index); @SuppressWarnings("unchecked") void clear(); Iterator<E> iterator(); }
AvlTreeList extends AbstractList<E> { public void add(int index, E val) { if (index < 0 || index > size()) throw new IndexOutOfBoundsException(); if (size() == Integer.MAX_VALUE) throw new IllegalStateException("Maximum size reached"); root = root.insertAt(index, val); } AvlTreeList();  AvlTreeList(Collection<? extends E> coll); int size(); E get(int index); E set(int index, E val); void add(int index, E val); E remove(int index); @SuppressWarnings("unchecked") void clear(); Iterator<E> iterator();  }