### Question:
UrlUtils { public static String trimSlashes(String string) { return string.replaceAll("^/|/$", ""); }  static String trimSlashes(String string); static String getEncodedUrl(String url); static String removeFirstAndLastSlash(String uri); static String addFirstSlash(String uri); static String removeLastSlash(String uri); static String getHostIPAddress(String fqdn); static String getIpAddressFromUrl(String urlString);  }### Answer:
@Test public void testTrimSlashes() { assertEquals("abc", UrlUtils.trimSlashes("abc")); assertEquals("abc", UrlUtils.trimSlashes("abc/")); assertEquals("abc", UrlUtils.trimSlashes("/abc")); assertEquals("abc", UrlUtils.trimSlashes("/abc/")); assertEquals("", UrlUtils.trimSlashes("")); assertEquals("/", UrlUtils.trimSlashes(" assertEquals("", UrlUtils.trimSlashes(" }