PathUtils { public static String removeLeadingSlash(String path) { if (path != null && !path.isEmpty() && path.charAt(0) == '/') { return path.substring(1); } return path; }  static String join(String... paths); static String normalize(String path); static boolean isAbsolute(String path); static String removeLeadingSlash(String path); static String addLeadingSlash(String path); static String addTrailingSlash(String path);  }
@Test public void testRemoveLeadingSlash() { assertEquals("abc", removeLeadingSlash("/abc")); assertEquals("abc/abc", removeLeadingSlash("/abc/abc")); String pathWithoutLeadingSlash = "abc/abc"; assertEquals(pathWithoutLeadingSlash, removeLeadingSlash(pathWithoutLeadingSlash)); }