### Question:
PathUtils { public static String collectPath(String... pathParts) { final StringBuilder sb = new StringBuilder(); for (String item : pathParts) { if (StringUtils.isBlank(item)) { continue; } final String path = trimPath(item); if (StringUtils.isNotBlank(path)) { sb.append(SLASH).append(path); } } return sb.length() > 0 ? sb.toString() : String.valueOf(SLASH); }  static String parsePath(String uri, Map<String, String> patterns); static String collectPath(String... pathParts);  }### Answer:
@Test(description = "collect path") public void collectPath() { final String path = PathUtils.collectPath("api", "/users/", "{userId}/"); assertEquals(path, "/api/users/{userId}"); }
@Test(description = "collect path with many slashes inside") public void collectPathWithSlashesInside() { final String path = PathUtils.collectPath(" assertEquals(path, "/api/users/getUser"); }
@Test(description = "not fail when passed path is null") public void testNullCollectedPath() { final String path = PathUtils.collectPath(null, null); assertEquals(path, "/"); }
@Test(description = "not fail when passed path is empty") public void testEmptyCollectedPath() { final String path = PathUtils.collectPath(""); assertEquals(path, "/"); }