### Question:
Benchmark { public static <T extends QueryMatch> BenchmarkResults<T> run(Monitor monitor, Iterable<InputDocument> documents, int batchsize, MatcherFactory<T> matcherFactory) throws IOException { BenchmarkResults<T> results = new BenchmarkResults<>(); for (DocumentBatch batch : batchDocuments(documents, batchsize)) { Matches<T> matches = monitor.match(batch, matcherFactory); results.add(matches); } return results; } private  Benchmark(); static BenchmarkResults<T> run(Monitor monitor, Iterable<InputDocument> documents,
                                                                 int batchsize, MatcherFactory<T> matcherFactory); static Iterable<DocumentBatch> batchDocuments(Iterable<InputDocument> documents, int batchsize); static BenchmarkResults<PresearcherMatch> timePresearcher(Monitor monitor, int batchsize, Iterable<InputDocument> documents); static ValidatorResults<T> validate(Monitor monitor, Iterable<ValidatorDocument<T>> documents,
                                                                      MatcherFactory<T> matcherFactory);  }### Answer:
@Test public void testBasicBenchmarking() throws IOException { List<InputDocument> docs = ImmutableList.of( InputDocument.builder("doc1").addField("f", "some text about the world", STANDARD).build(), InputDocument.builder("doc2").addField("f", "some text about cheese", STANDARD).build() ); BenchmarkResults<QueryMatch> results = Benchmark.run(monitor, docs, 1, SimpleMatcher.FACTORY); assertThat(results.getTimer().getCount()).isEqualTo(2); }