### Question:
WritableIndexReferenceFactory extends IndexReferenceFactory { @Override IndexReference createIndexReference( IndexIdentifier identifier ) throws IOException, ExplicitIndexNotFoundKernelException { IndexWriter writer = newIndexWriter( identifier ); IndexReader reader = DirectoryReader.open( writer, true ); IndexSearcher indexSearcher = newIndexSearcher( identifier, reader ); return new WritableIndexReference( identifier, indexSearcher, writer ); } WritableIndexReferenceFactory( LuceneDataSource.LuceneFilesystemFacade filesystemFacade, File baseStorePath,
            IndexTypeCache typeCache );   }### Answer:
@Test public void createWritableIndexReference() throws Exception { WritableIndexReferenceFactory indexReferenceFactory = createFactory(); IndexReference indexReference = createIndexReference( indexReferenceFactory ); assertNotNull( "Index should have writer.", indexReference.getWriter() ); }