### Question:
UrlUtils { public static String sanitizePath(final String path) { if (StringUtils.isEmpty(path)) { return path; } if (path.endsWith("/")) { return path.substring(0, path.length() - 1); } return path; }  static boolean isHttpUrl(final String url); static boolean isHttpsUrl(final String url); static String toBaseUrl(final String uriString); static String sanitizePath(final String path); static String combine(final String... parts);  }### Answer:
@Test public void testSanitizeUrl() { final String result = UrlUtils.sanitizePath("http: assertThat(result).as("Sanitized Path").isEqualTo("http: }
@Test public void testSanitizeUrlWithSlash() { final String result = UrlUtils.sanitizePath("http: assertThat(result).as("Sanitized Path").isEqualTo("http: }
@Test public void testSanitizePath() { final String result = UrlUtils.sanitizePath("/a/b/c"); assertThat(result).as("Sanitized Path").isEqualTo("/a/b/c"); }
@Test public void testSanitizePathWithSlash() { final String result = UrlUtils.sanitizePath("/a/b/c/"); assertThat(result).as("Sanitized Path").isEqualTo("/a/b/c"); }