SampleIndexGenerator { public void createIndex(String input, String output, int wordsPerDoc, int indexSize) { createIndex(getWordList(input), output, wordsPerDoc, indexSize); }  void createIndex(String input, String output, int wordsPerDoc, int indexSize); void createIndex(String[] wordList, String output, int wordsPerDoc, int indexSize);  }
@Test public void testCreateIndex() throws Exception { SampleIndexGenerator sampleIndexGenerator = new SampleIndexGenerator(); File inputFile = _temporaryFolder.newFile("inputFile"); TestIoUtil.writeFile(inputFile, "Project Gutenberg's Alice's Adventures in Wonderland, by Lewis Carroll", "Title: Alice's Adventures in Wonderland"); File file = _temporaryFolder.newFolder("sampleIndex"); file.mkdirs(); sampleIndexGenerator.createIndex(inputFile.getAbsolutePath(), file.getAbsolutePath(), 10, 10); assertTrue(IndexReader.indexExists(FSDirectory.open(file.listFiles()[0]))); }