Util { public static StringBuilder getContextUrlString(String baseUrl, String context) throws MalformedURLException { StringBuilder urlStr = new StringBuilder(baseUrl); ensureEndsWithSlash(urlStr); if (context != null && context.length() > 0) { if (context.startsWith("/")) { urlStr.append(context.substring(1)); } else { urlStr.append(context); } ensureEndsWithSlash(urlStr); } return urlStr; }  static String toJson(Object obj); static T fromJson(String json, Class<T> clazz); static T fromJson(Reader in, TypeReference<T> typeReference); static String urlEncode(String str); static String urlEncodeQuery(String str); static StringBuilder getContextUrlString(String baseUrl, String context); static void ensureEndsWithSlash(StringBuilder str); static long copyStream(InputStream input, OutputStream output, boolean closeStreams); static String slurpStream(InputStream input, String encoding); static String read(File file); static void write(String string, File file); static String base64Encode(String plainTextString); static String getMachineId(); static String getContainerId(); static String extractDockerContainerIdFromString(String s); static Properties extractPropertiesFromExpression(String expression);  }
@Test public void getContextUrl() throws MalformedURLException { StringBuilder url = Util.getContextUrlString("http: Assert.assertEquals("http: }