### Question:
TermDocIterable implements Iterable<Document> { public TermDocIterable(TermDocs termDocs, IndexReader reader, FieldSelector fieldSelector) { this.termDocs = termDocs; this.reader = reader; this.fieldSelector = fieldSelector; } TermDocIterable(TermDocs termDocs, IndexReader reader, FieldSelector fieldSelector); @Override Iterator<Document> iterator();  }### Answer:
@SuppressWarnings("serial") @Test public void testTermDocIterable() throws IOException { for (int pass = 0; pass < 1; pass++) { for (int id = 0; id < BLOCKS; id++) { TermDocs termDocs = reader.termDocs(new Term("id", Integer.toString(id))); TermDocIterable iterable = new TermDocIterable(termDocs, reader, new FieldSelector() { @Override public FieldSelectorResult accept(String fieldName) { return FieldSelectorResult.LOAD; } }); int count = 0; int i = 0; long s = System.nanoTime(); for (Document document : iterable) { count++; assertEquals(i, Integer.parseInt(document.get("field"))); i++; } long time = System.nanoTime() - s; System.out.println(time / 1000000.0 + " " + id + " " + pass); assertEquals(COUNT_PER_BLOCK, count); } } }