PathUtils { public static String join(String path1, String path2) { path1 = trimPathSeparatorBothSides(path1); path2 = trimPathSeparatorBothSides(path2); return FilenameUtils.normalizeNoEndSeparator(path1 + "/" + path2, true); }  static String removePrependedSlash(String path); static String join(String path1, String path2); static String trimPathSeparatorBothSides(String path); static String removeDuplicatedPrependedSlash(String path); static String getSubPath(String basePath, String path);  }
@Test public void testJoin() throws Exception { assertThat(PathUtils.join("/hello/world", "wow")).isEqualTo("hello/world/wow"); assertThat(PathUtils.join("/hello/world", "wow/")).isEqualTo("hello/world/wow"); assertThat(PathUtils.join("/hello/world assertThat(PathUtils.join("/hello/world assertThat(PathUtils.join(" assertThat(PathUtils.join("hello/world assertThat(PathUtils.join("hello/world assertThat(PathUtils.join("/hello/world }