@Test
public void testDirectoryReferenceCounter() throws CorruptIndexException, LockObtainFailedException, IOException, InterruptedException {
Directory directory = wrap(new RAMDirectory());
DirectoryReferenceFileGC gc = new DirectoryReferenceFileGC();
gc.init();
IndexInputCloser closer = new IndexInputCloser();
closer.init();
DirectoryReferenceCounter counter = new DirectoryReferenceCounter(directory, gc, closer);
IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
IndexWriter writer = new IndexWriter(counter, conf);
int size = 100;
IndexReader[] readers = new IndexReader[size];