### Question:
UrlParts { public static String concatPaths(Object... parts) { String result = ""; if (parts != null) { for (Object p : parts) { String str = String.valueOf(p); if (p != null && !StringUtils.isEmpty(str)) { if (result.length() > 0 && !str.startsWith("/") && !result.endsWith("/")) { result += "/"; } result += str; } } } return result; }  static String concatPaths(Object... parts); static String ensureEndsWithSlash(String uri); static String ensureStartsWithSlash(String uri); static String ensureStartsAndEndsWithSlash(String path); static String removeEndsWithSlash(String path); static String getBaseUrl(HttpServletRequest request);  }### Answer:
@Test public void testConcatPaths() { String blaSample = UrlParts.concatPaths("bla", 23); String nullSample = UrlParts.concatPaths(null); String withEndSample = UrlParts.concatPaths("/bla/", 23); assertThat(blaSample, equalTo("bla/23")); assertThat(nullSample, equalTo("")); assertThat(withEndSample, equalTo("/bla/23")); }