RegistryPathUtils { public static String lastPathEntry(String path) { List<String> splits = split(path); if (splits.isEmpty()) { return ""; } else { return splits.get(splits.size() - 1); } }  static String validateZKPath(String path); static String validateElementsAsDNS(String path); static String createFullPath(String base, String path); static String join(String base, String path); static List<String> split(String path); static String lastPathEntry(String path); static String parentOf(String path); static String encodeForRegistry(String element); static String encodeYarnID(String yarnId); static String getUsername(String recPath);  }
@Test public void testLastPathEntry() throws Throwable { assertEquals("",lastPathEntry("/")); assertEquals("",lastPathEntry(" assertEquals("c",lastPathEntry("/a/b/c")); assertEquals("c",lastPathEntry("/a/b/c/")); }