UrlSupport { public static String concat(String prefix, String suffix) { return concat(prefix, suffix, false); } private  UrlSupport(); static URI uri(String uri); static URL url(String url); static URL url(String protocol, String host, int port); static URL url(URL context, String spec); static String concat(String prefix, String suffix); static String concat(String prefix, String suffix, boolean close); static String concat(String... parts); static String concat(List<String> parts); static URI uri(Object... parts); static String removeDoubleSeparator(String path); static final String DEFAULT_BASE_URL; }
@Test public void testConcat() { assertEquals("first/second", UrlSupport.concat("first", "second")); assertEquals("first/second", UrlSupport.concat("first", "/second")); assertEquals("first/second", UrlSupport.concat("first/", " assertEquals("/first/second", UrlSupport.concat("/first/", " assertEquals("/first", UrlSupport.concat("/", "first")); assertEquals("/first/", UrlSupport.concat("/", "first/", true)); assertEquals("/first/", UrlSupport.concat("/", "first", true)); assertEquals("first/second/", UrlSupport.concat("first", "second", true)); assertEquals("first/second/", UrlSupport.concat("first", "second assertEquals("first/second/third", UrlSupport.concat("first", "second assertEquals("http: }