FileWorkspaceImpl implements FileWorkspace { @Override public Path getRootFolder() throws IOException { return rootFolder; } 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 testGetRootFolder() throws IOException { assertThat(FileWorkspaceImpl.getRootFolder(JIM_FS.getPath("/workspace.xml"))) .isAbsolute() .hasFileName("workspace") .matches(o -> o.getFileSystem().equals(JIM_FS)); assertThatThrownBy(() -> FileWorkspaceImpl.getRootFolder(null)).isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> FileWorkspaceImpl.getRootFolder(JIM_FS.getPath("/"))).isInstanceOf(IOException.class); }