@Test public void testRemove() { List<Character> list = newList(); { String str = "the quick brown fox jumped over the lazy dog"; for (int i = 0; i < str.length(); i++) list.add(str.charAt(i)); assertEquals(str.length(), list.size()); } assertEquals('e', (char)list.remove( 2)); assertEquals('u', (char)list.remove( 4)); assertEquals('q', (char)list.remove( 3)); assertEquals(' ', (char)list.remove( 2)); assertEquals('f', (char)list.remove(12)); assertEquals(' ', (char)list.remove(11)); assertEquals('n', (char)list.remove(10)); assertEquals('w', (char)list.remove( 9)); assertEquals(' ', (char)list.remove(11)); assertEquals('j', (char)list.remove(11)); assertEquals('u', (char)list.remove(11)); assertEquals('x', (char)list.remove(10)); assertEquals('p', (char)list.remove(11)); assertEquals('d', (char)list.remove(12)); assertEquals('e', (char)list.remove(11)); assertEquals('v', (char)list.remove(13)); assertEquals('e', (char)list.remove(13)); assertEquals('l', (char)list.remove(19)); assertEquals('z', (char)list.remove(20)); assertEquals('a', (char)list.remove(19)); assertEquals(' ', (char)list.remove(18)); assertEquals('g', (char)list.remove(22)); { String str = "thick broom or they do"; assertEquals(str.length(), list.size()); for (int i = 0; i < str.length(); i++) assertEquals(str.charAt(i), (char)list.get(i)); } assertEquals('t', (char)list.remove(0)); assertEquals('c', (char)list.remove(2)); assertEquals('k', (char)list.remove(2)); assertEquals(' ', (char)list.remove(2)); assertEquals('b', (char)list.remove(2)); assertEquals('r', (char)list.remove(2)); assertEquals('o', (char)list.remove(2)); assertEquals('o', (char)list.remove(2)); assertEquals('o', (char)list.remove(4)); assertEquals('h', (char)list.remove(7)); assertEquals(' ', (char)list.remove(5)); assertEquals('t', (char)list.remove(5)); assertEquals('o', (char)list.remove(9)); assertEquals(' ', (char)list.remove(7)); assertEquals('y', (char)list.remove(6)); { String str = "him red"; assertEquals(str.length(), list.size()); for (int i = 0; i < str.length(); i++) assertEquals(str.charAt(i), (char)list.get(i)); } }
public E remove(int index) { if (index < 0 || index >= size()) throw new IndexOutOfBoundsException(); E result = get(index); root = root.removeAt(index); return result; }
AvlTreeList extends AbstractList<E> { public E remove(int index) { if (index < 0 || index >= size()) throw new IndexOutOfBoundsException(); E result = get(index); root = root.removeAt(index); return result; } }
AvlTreeList extends AbstractList<E> { public E remove(int index) { if (index < 0 || index >= size()) throw new IndexOutOfBoundsException(); E result = get(index); root = root.removeAt(index); return result; } AvlTreeList();  AvlTreeList(Collection<? extends E> coll); }
AvlTreeList extends AbstractList<E> { public E remove(int index) { if (index < 0 || index >= size()) throw new IndexOutOfBoundsException(); E result = get(index); root = root.removeAt(index); return result; } 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 E remove(int index) { if (index < 0 || index >= size()) throw new IndexOutOfBoundsException(); E result = get(index); root = root.removeAt(index); return result; } 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();  }