LocalResourceId implements ResourceId { @Override public String toString() { return pathString; } private  LocalResourceId(Path path, boolean isDirectory); @Override LocalResourceId resolve(String other, ResolveOptions resolveOptions); @Override LocalResourceId getCurrentDirectory(); @Override @Nullable String getFilename(); @Override String getScheme(); @Override boolean isDirectory(); @Override String toString(); @Override boolean equals(@Nullable Object obj); @Override int hashCode();  }
@Test public void testToString() throws Exception { File someFile = tmpFolder.newFile("somefile"); LocalResourceId fileResource = LocalResourceId.fromPath(someFile.toPath(), false); assertThat(fileResource.toString(), not(endsWith(File.separator))); assertThat(fileResource.toString(), containsString("somefile")); assertThat(fileResource.toString(), startsWith(tmpFolder.getRoot().getAbsolutePath())); LocalResourceId dirResource = LocalResourceId.fromPath(someFile.toPath(), true); assertThat(dirResource.toString(), endsWith(File.separator)); assertThat(dirResource.toString(), containsString("somefile")); assertThat(dirResource.toString(), startsWith(tmpFolder.getRoot().getAbsolutePath())); }