### Question:
UnixSocketFileSystemProvider extends DelegatingFileSystemProvider { @Override public Path getPath(final URI uri) { return super.getPath(convert(uri)); } UnixSocketFileSystemProvider();  UnixSocketFileSystemProvider(final FileSystemProvider delegate); @Override String getScheme(); @Override FileSystem newFileSystem(final URI uri, final Map<String, ?> env); @Override FileSystem getFileSystem(final URI uri); @Override Path getPath(final URI uri);  }### Answer:
@Test public void getPath() { URI uri = URI.create("unix:/bogus.ipc"); provider.getPath(uri); URI u = URI.create("file:/bogus.ipc"); verify(delegate).getPath(u); }
@Test public void getRelativePathUsingDot() { URI uri = URI.create("unix:./bogus.ipc"); provider.getPath(uri); Path currentRelativePath = Paths.get(""); String s = currentRelativePath.toAbsolutePath().toString(); URI u = URI.create("file:./bogus.ipc".replaceFirst("\\.",s)); verify(delegate).getPath(u); }
@Test public void getRelativePathNotUsingDot() { URI uri = URI.create("unix:bogus.ipc"); provider.getPath(uri); Path currentRelativePath = Paths.get(""); String s = currentRelativePath.toAbsolutePath().toString(); URI u = URI.create(String.format("file:%s/bogus.ipc",s)); verify(delegate).getPath(u); }
@Test public void getInavlidPathUsingDoubleDots() { final URI uri = URI.create("unix:../bogus.ipc"); try { provider.getPath(uri); failBecauseExceptionWasNotThrown(UncheckedIOException.class); } catch (UncheckedIOException ex) { assertThat(ex.getCause()).isExactlyInstanceOf(IOException.class); assertThat(ex.getCause().getCause()).isExactlyInstanceOf(URISyntaxException.class); } }