### Question:
LuceneTermCorpus extends AbstractTermCorpus { public LuceneTermCorpus(Directory directory) { this.directory = directory; } LuceneTermCorpus(Directory directory); @Override int getCount(String term); @Override int getNumDocs(); @Override int getNumTerms(); @Override int getNumUniqueTerms(); static void main(String[] args);  }### Answer:
@Test public void testLuceneTermCorpus() { Directory directory = getSample(); TermCorpus corpus = new LuceneTermCorpus(directory); assertEquals(5, corpus.getNumDocs()); assertEquals(Math.log(5. / 1), corpus.getIdf("quick", false), 0); assertEquals(Math.log(5. / 2), corpus.getIdf("brown", false), 0); }