UriBuilder { public static String cleanUri(String uri) { return URICLEANPATTERN.matcher(uri).replaceAll("/"); } private  UriBuilder(); static String concatUriSegments(String... segments); static String cleanUri(String uri);  }
@Test public void cleanDoubleSlash() { Assert.assertEquals("segment1/segment2", UriBuilder.cleanUri("segment1/segment2")); Assert.assertEquals("segment1/segment2", UriBuilder.cleanUri("segment1 Assert.assertEquals("http: Assert.assertEquals("https: Assert.assertEquals("https: }