LuceneService { public void indexDocuments(List<Document> docs) { IndexWriter writer = getWriter(); for (Document document : docs) { try { writer.addDocument(document); } catch (Exception e) { e.printStackTrace(); closeWriter(writer); throw new RuntimeException(e); } } closeWriter(writer); } LuceneService();   LuceneService(Directory directory); void indexDocument(Document doc); void indexDocuments(List<Document> docs); void removeDocument(Query query); void removeDocuments(List<Query> queries); List<Document> search(Query query, boolean prefixWildCard); void clearIndex();  }
@Test public void testIndexDocuments_1() throws Exception { LuceneService fixture = new LuceneService(); List<Document> docs = new LinkedList<>(); fixture.indexDocuments(docs); }
@Test public void testIndexDocuments_2() throws Exception { LuceneService fixture = new LuceneService(); List<Document> docs = new LinkedList<>(); fixture.indexDocuments(docs); }