FastArrayList extends UnsupportedList<T> implements
		RunnerLoop<T> { @Override public Iterator<T> iterator() { return new ThisIterator(array); } @SuppressWarnings("unchecked")  FastArrayList(); @SuppressWarnings("unchecked")  FastArrayList(final int size);  FastArrayList(final T[] array); @Override boolean add(final T item); @Override @SuppressWarnings("unchecked") boolean remove(final Object item); @Override Iterator<T> iterator(); @Override int size(); @Override boolean isEmpty(); @ThreadSafe(rule = "does not reflect concurrent modifications") @Override void runLoop(final Runner<R, T> task, final List<R> list); @Override Object[] toArray(); @SuppressWarnings("unchecked") @Override T[] toArray(final T[] instance);  }
@Test public void testIterator() { boolean isAdded, isRemoved; final FastArrayList<Integer> array = new FastArrayList<Integer>(); assertTrue(array.isEmpty()); final Integer one = 123456; final Integer two = 654321; isAdded = array.add(one); assertTrue(isAdded); isAdded = array.add(two); assertTrue(isAdded); assertEquals(array.size(), 2); isAdded = array.add(one); assertFalse(isAdded); isAdded = array.add(two); assertFalse(isAdded); assertEquals(array.size(), 2); int count1 = 0; for (final Integer item : array) { count1++; } assertEquals(count1, 2); int count2 = 0; for (final Integer item : array) { count2++; } assertEquals(count2, 2); isRemoved = array.remove(two); assertTrue(isRemoved); assertEquals(array.size(), 1); isRemoved = array.remove(two); assertFalse(isRemoved); assertEquals(array.size(), 1); isRemoved = array.remove(one); assertTrue(isRemoved); assertEquals(array.size(), 0); isRemoved = array.remove(one); assertFalse(isRemoved); assertEquals(array.size(), 0); }