### Question:
UrlUtils { public static String removeFirstAndLastSlash(String uri) { return StringUtils.removeFirstAndLastOccurrence(uri, "/"); }  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 removeFirstAndLastSlash() { assertNull(UrlUtils.removeFirstAndLastSlash(null)); String whiteSpace = " "; assertEquals("", UrlUtils.removeFirstAndLastSlash(whiteSpace)); String hasSlashes = " /blah/ "; assertEquals("blah", UrlUtils.removeFirstAndLastSlash(hasSlashes)); }