RegistryPathUtils { public static List<String> split(String path) { String[] pathelements = path.split("/"); List<String> dirs = new ArrayList<String>(pathelements.length); for (String pathelement : pathelements) { if (!pathelement.isEmpty()) { dirs.add(pathelement); } } return dirs; }  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 testSplittingEmpty() throws Throwable { assertEquals(0, split("").size()); assertEquals(0, split("/").size()); assertEquals(0, split(" }
@Test public void testSplitting() throws Throwable { assertEquals(1, split("/a").size()); assertEquals(0, split("/").size()); assertEquals(3, split("/a/b/c").size()); assertEquals(3, split("/a/b/c/").size()); assertEquals(3, split("a/b/c").size()); assertEquals(3, split("/a/b assertEquals(3, split(" List<String> split = split(" assertEquals("a", split.get(0)); assertEquals("b", split.get(1)); assertEquals("c", split.get(2)); }