### Question:
PartitionedIndexStorage { public Map<File,Directory> openIndexDirectories() throws IOException { Map<File,Directory> directories = new LinkedHashMap<>(); try { for ( File dir : listFolders() ) { directories.put( dir, directoryFactory.open( dir ) ); } } catch ( IOException oe ) { try { IOUtils.closeAll( directories.values() ); } catch ( Exception ce ) { oe.addSuppressed( ce ); } throw oe; } return directories; } PartitionedIndexStorage( DirectoryFactory directoryFactory, FileSystemAbstraction fileSystem, File rootFolder ); Directory openDirectory( File folder ); File getPartitionFolder( int partition ); File getIndexFolder(); void reserveIndexFailureStorage(); void storeIndexFailure( String failure ); String getStoredIndexFailure(); void prepareFolder( File folder ); void cleanupFolder( File folder ); Map<File,Directory> openIndexDirectories(); List<File> listFolders();  }### Answer:
@Test void openIndexDirectories() throws IOException { File indexFolder = storage.getIndexFolder(); createRandomLuceneDir( indexFolder ).close(); createRandomLuceneDir( indexFolder ).close(); Map<File,Directory> directories = storage.openIndexDirectories(); try { assertEquals( 2, directories.size() ); for ( Directory dir : directories.values() ) { assertFalse( ArrayUtil.isEmpty( dir.listAll() ) ); } } finally { IOUtils.closeAll( directories.values() ); } }