@Test
public void testGet() throws Exception {

  final int NUM_ELEMS = 100001;
  ChunkedArrayList<Integer> list = new ChunkedArrayList<Integer>();
  for (int i = 0; i < NUM_ELEMS; i++) {
    list.add(i);
  }
  Assert.assertEquals(Integer.valueOf(100), list.get(100));
  Assert.assertEquals(Integer.valueOf(1000), list.get(1000));
  Assert.assertEquals(Integer.valueOf(10000), list.get(10000));
  Assert.assertEquals(Integer.valueOf(100000), list.get(100000));
  Iterator<Integer> iter = list.iterator();
  iter.next();
  iter.remove();
  Assert.assertEquals(Integer.valueOf(1), list.get(0));
  iter = list.iterator();
  for (int i = 0; i < 500; i++) {
    iter.next();
  }
  iter.remove();
  Assert.assertEquals(Integer.valueOf(502), list.get(500));
  Assert.assertEquals(Integer.valueOf(602), list.get(600));
}