LuceneService { public void clearIndex() { IndexWriter writer = getWriter(); try { writer.deleteAll(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } finally { 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 testClearIndex_1() throws Exception { LuceneService fixture = new LuceneService(); fixture.clearIndex(); }