}
writer.flush(); // flush remaining data
out.close();
final DocsFreqBlockIndexInput in = this.getIndexInput();
final DocsFreqBlockReader reader = in.getBlockReader();
reader.setNodeBlockIndex(in.index());
reader.setPosBlockIndex(in.index());
for (int i = 0; i < 11777; i++) {
if (reader.isExhausted()) {
reader.nextBlock();
}
assertEquals(i, reader.nextDocument());
final int frq = reader.nextNodeFreq();
assertTrue(frq > 0);
assertTrue(frq <= 10);
}
in.close();
}