@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--;
      }
    };
  }
@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++;
    }
  }