### Question:
LuceneConfigurations { public static final LuceneConfiguration inMemory() { return new RamDirectoryFactory(); }  static final LuceneConfiguration inMemory(); static final LuceneConfiguration using( File parent ); static final LuceneConfiguration using( File parent,
                                                   LockFactory lockFactory ); static final LuceneConfiguration using( File parent,
                                                   TextEncoder workspaceNameEncoder,
                                                   TextEncoder indexNameEncoder ); static final LuceneConfiguration using( File parent,
                                                   LockFactory lockFactory,
                                                   TextEncoder workspaceNameEncoder,
                                                   TextEncoder indexNameEncoder );  }### Answer:
@Test public void shouldCreateConfigurationFromInMemoryStorage() { config = LuceneConfigurations.inMemory(); assertThat(config, is(notNullValue())); directory = getDirectory(config, workspace, index); assertThat(directory, is(instanceOf(RAMDirectory.class))); }
@Test public void shouldReturnSameDirectoryForSameWorkspaceAndIndexNamesFromInMemoryConfiguration() { config = LuceneConfigurations.inMemory(); assertThat(config, is(notNullValue())); directory = getDirectory(config, workspace, index); assertThat(directory, is(instanceOf(RAMDirectory.class))); for (int i = 0; i != 10; ++i) { assertThat(getDirectory(config, workspace, index), is(sameInstance(directory))); } assertThat(indexNamesByWorkspaceName.size(), is(1)); }