FileWorkspaceImpl implements FileWorkspace { @NonNull public static FileWorkspaceImpl open(@NonNull Path file, @NonNull FileFormat format, @NonNull Supplier<Iterable<FamilyHandler>> handlers) throws IOException { Objects.requireNonNull(file, "file"); Objects.requireNonNull(format, "format"); Objects.requireNonNull(handlers, "handler"); return open(LoggerFactory.getLogger(FileWorkspaceImpl.class), file, format, handlers); } private  FileWorkspaceImpl(Path indexFile, FileFormat fileFormat, Path rootFolder, Indexer indexer, SafeHandler handlers); @NonNull static Optional<FileFormat> probeFormat(@NonNull Path file); @NonNull static FileWorkspaceImpl create(@NonNull Path file, @NonNull FileFormat format, @NonNull Supplier<Iterable<FamilyHandler>> handlers); @NonNull static FileWorkspaceImpl open(@NonNull Path file, @NonNull FileFormat format, @NonNull Supplier<Iterable<FamilyHandler>> handlers); @Override String getName(); @Override void setName(String name); @Override Collection<WorkspaceFamily> getSupportedFamilies(); @Override Collection<WorkspaceItem> getItems(); @Override Object load(WorkspaceItem item); @Override void store(WorkspaceItem item, Object value); @Override void delete(WorkspaceItem item); @Override void close(); @Override FileFormat getFileFormat(); @Override Path getFile(); @Override Path getRootFolder(); @Override Path getFile(WorkspaceItem item);  }
@Test public void testUnexpected() throws IOException { assertThatThrownBy(() -> FileWorkspaceImpl.open(GENERIC_INDEX, FileFormat.GENERIC, FileWorkspaceImplTest::getHandlersButThrowUnexpected)) .isInstanceOf(IOException.class) .hasCauseInstanceOf(RuntimeException.class); }