even[i] = uidArray[i * 2];
ans[i] = i;
}
DocIDMapperImpl mapper = new DocIDMapperImpl(even);
UIDDocIdSet uidSet = new UIDDocIdSet(even, mapper);
DocIdSetIterator docidIter = uidSet.iterator();
IntArrayList intList = new IntArrayList();
int docid;
while ((docid = docidIter.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
intList.add(docid);
}
assertTrue("wrong result from iter", Arrays.equals(ans, intList.toIntArray()));
long[] newidArray = new long[count];
for (int i = 0; i < count; ++i) {
newidArray[i] = i;
}
mapper = new DocIDMapperImpl(newidArray);
uidSet = new UIDDocIdSet(newidArray, mapper);
docidIter = uidSet.iterator();
intList = new IntArrayList();
for (int i = 0; i < newidArray.length; ++i) {
docid = docidIter.advance(i * 10);
if (docid == DocIdSetIterator.NO_MORE_DOCS) break;
intList.add(docid);