LocalResourceId implements ResourceId { @Override public @Nullable String getFilename() { Path fileName = getPath().getFileName(); return fileName == null ? null : fileName.toString(); } 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 testGetFilename() { assertNull(toResourceIdentifier("/").getFilename()); assertEquals("tmp", toResourceIdentifier("/root/tmp").getFilename()); assertEquals("tmp", toResourceIdentifier("/root/tmp/").getFilename()); assertEquals("xyz.txt", toResourceIdentifier("/root/tmp/xyz.txt").getFilename()); }