ChunkedArrayList extends AbstractList<T> { @Override public Iterator<T> iterator() { final Iterator<T> it = Iterables.concat(chunks).iterator(); return new Iterator<T>() { @Override public boolean hasNext() { return it.hasNext(); } @Override public T next() { return it.next(); } @Override public void remove() { it.remove(); size--; } }; } ChunkedArrayList();  ChunkedArrayList(int initialChunkCapacity, int maxChunkSize); @Override Iterator<T> iterator(); @Override boolean add(T e); @Override void clear(); @Override boolean isEmpty(); @Override int size(); @Override T get(int idx);  }
@Test public void testIterator() { ChunkedArrayList<Integer> l = new ChunkedArrayList<Integer>(); for (int i = 0; i < 30000; i++) { l.add(i); } int i = 0; for (int fromList : l) { assertEquals(i, fromList); i++; } }