CollectionSizedIterator implements SizedIterator<OBJECTT> { @Pure @Override public int index() { return this.index; } CollectionSizedIterator(Collection<OBJECTT> collection); @Pure @Override boolean hasNext(); @Override OBJECTT next(); @Override void remove(); @Pure @Override int index(); @Pure @Override int totalSize(); @Pure @Override int rest();  }
@Test public void index() { assertEquals(-1, this.iterator.index()); assertSame(this.s1, this.iterator.next()); assertEquals(0, this.iterator.index()); assertSame(this.s2, this.iterator.next()); assertEquals(1, this.iterator.index()); assertSame(this.s3, this.iterator.next()); assertEquals(2, this.iterator.index()); assertSame(this.s4, this.iterator.next()); assertEquals(3, this.iterator.index()); assertSame(this.s5, this.iterator.next()); assertEquals(4, this.iterator.index()); }