LongArray implements Array<Long> { @Override public Iterator<Long> iterator() { return new Iter(); } LongArray(int initialCapacity);  LongArray(); @Override synchronized Long get(int i); @Override int size(); @Override synchronized int capacity(); @Override Long set(int i, Long value); @Override synchronized int append(Long value); @Override synchronized Long remove(int i); @Override int resize(int sizeHint); @Override Iterator<Long> iterator();  }
@Test(groups = "fast") public void testIterator() throws Exception { Iterator<Long> iter = array.iterator(); Assert.assertEquals(iter.next().longValue(), 1L); iter.hasNext(); iter.hasNext(); iter.hasNext(); Assert.assertEquals(iter.next().longValue(), 2L); iter.remove(); Assert.assertEquals(iter.next().longValue(), 3L); Assert.assertEquals(iter.next().longValue(), 4L); Assert.assertEquals(iter.next().longValue(), 5L); Assert.assertEquals(iter.next().longValue(), 6L); }