### Question:
UrlParts { public static String ensureStartsAndEndsWithSlash(String path) { String fixedStart = ensureStartsWithSlash(path); return ensureEndsWithSlash(fixedStart); }  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 ensureStartsAndEndsWithSlash() { String blaSample = UrlParts.ensureStartsAndEndsWithSlash("/bla"); String nullSample = UrlParts.ensureStartsAndEndsWithSlash(null); String withEndSample = UrlParts.ensureStartsAndEndsWithSlash("bla/"); String withoutSample = UrlParts.ensureStartsAndEndsWithSlash("bla"); assertThat(blaSample, equalTo("/bla/")); assertThat(nullSample, equalTo("/")); assertThat(withEndSample, equalTo("/bla/")); assertThat(withoutSample, equalTo("/bla/")); }