@Test public void testCloseAfterIncRef() throws Exception { Directory dir = newDirectory(); DirectoryTaxonomyWriter ltw = new DirectoryTaxonomyWriter(dir); ltw.addCategory(new FacetLabel("a")); ltw.close(); DirectoryTaxonomyReader ltr = new DirectoryTaxonomyReader(dir); ltr.incRef(); ltr.close(); // should not fail as we incRef() before close ltr.getSize(); ltr.decRef(); dir.close(); }