assertTrue(iter1.hasNext());
assertEquals(randomIndex, iter1.index());
assertEquals(randomIndex, iter1.next().intValue());
// Test ArrayStoreIndexIterator
ArrayStoreIterator iter2 = new ArrayStoreIterator(_store);
assertEquals(_store.getIndexStart(), iter2.index());
assertTrue(iter2.hasNext());
int cnt2 = 0;
while(iter2.hasNext()) {
iter2.next();
cnt2++;
}
assertEquals(_store.capacity(), cnt2);
for(int i = 0; i < 100; i++) {
iter2.reset(getRandomIndex());
}
try {
iter2.reset(_store.getIndexStart() - 1);
assertTrue(false);
} catch(ArrayIndexOutOfBoundsException e) {}
try {
iter2.reset(_store.getIndexStart() + _store.capacity());
assertTrue(false);
} catch(ArrayIndexOutOfBoundsException e) {}
iter2.reset(randomIndex);
assertTrue(iter2.hasNext());
assertEquals(randomIndex, iter2.index());
assertTrue(Arrays.equals(randomBytes, iter2.next().getValue()));
}