SimpleUnixFileSystem extends BaseSimpleFileSystem { @Override public Path getPath(String first, String... more) { if (UNIX_SEPARATOR_STRING.equals(first) && (more == null || more.length == 0)) { return GeneralPathImpl.createRoot(this, UNIX_SEPARATOR_STRING, false); } else { return super.getPath(first, more); } } protected  SimpleUnixFileSystem(final FileSystemProvider provider,
                         final String path); @Override Path getPath(String first, String... more); @Override Iterable<Path> getRootDirectories(); @Override Iterable<FileStore> getFileStores(); @Override void dispose();  }
@Test public void simpleRootTests() throws URISyntaxException { final SimpleFileSystemProvider fs = new SimpleFileSystemProvider(); final FileSystem fileSystem = new SimpleUnixFileSystem(fsProvider, "/"); assertThat(fileSystem.getPath("/")).isEqualTo(fileSystem.getPath("/path").getParent()); final URL parentUrl = this.getClass().getResource("/"); final Path parentNioPath = fs.getPath(parentUrl.toURI()); final URL childUrl = this.getClass().getResource("/Folder"); final Path childNioPath = fs.getPath(childUrl.toURI()); final Path childParentNioPath = childNioPath.getParent(); assertThat(parentNioPath).isEqualTo(childParentNioPath); }