### Question:
IndexDirectoryStructure { public static Factory directoriesByProvider( File databaseStoreDir ) { return descriptor -> new SubDirectoryByIndexId( path( baseSchemaIndexFolder( databaseStoreDir ), fileNameFriendly( descriptor ) ) ); }  static File baseSchemaIndexFolder( File databaseStoreDir ); static Factory directoriesByProviderKey( File databaseStoreDir ); static Factory directoriesByProvider( File databaseStoreDir ); static Factory given( IndexDirectoryStructure directoryStructure ); static Factory directoriesBySubProvider( IndexDirectoryStructure parentStructure ); abstract File rootDirectory(); abstract File directoryForIndex( long indexId ); static final Factory NONE; }### Answer:
@Test public void shouldSeeCorrectDirectoriesForProvider() { assertCorrectDirectories( directoriesByProvider( databaseStoreDir ).forProvider( provider ), path( baseIndexDirectory, provider.getKey() + "-" + provider.getVersion() ), path( baseIndexDirectory, provider.getKey() + "-" + provider.getVersion(), String.valueOf( indexId ) ) ); }
@Test public void shouldHandleWeirdCharactersInProviderKey() { IndexProviderDescriptor providerWithWeirdName = new IndexProviderDescriptor( "native+lucene", "1.0" ); assertCorrectDirectories( directoriesByProvider( databaseStoreDir ).forProvider( providerWithWeirdName ), path( baseIndexDirectory, "native_lucene-1.0" ), path( baseIndexDirectory, "native_lucene-1.0", String.valueOf( indexId ) ) ); }