### Question:
HttpUtil { public static String constructUrl( VariableSpace space, String hostname, String port, String webAppName, String serviceAndArguments ) throws UnsupportedEncodingException { return constructUrl( space, hostname, port, webAppName, serviceAndArguments, false ); }  static String constructUrl( VariableSpace space, String hostname, String port, String webAppName,
                                     String serviceAndArguments ); static String constructUrl( VariableSpace space, String hostname, String port, String webAppName,
                                     String serviceAndArguments, boolean isSecure ); static String getPortSpecification( VariableSpace space, String port ); static String decodeBase64ZippedString( String loggingString64 ); static String encodeBase64ZippedString( String in ); static final int ZIP_BUFFER_SIZE; }### Answer:
@Test public void testConstructUrl() throws Exception { Variables variables = new Variables(); String expected = "hostname:1234/webAppName?param=value"; Assert.assertEquals( "http: HttpUtil.constructUrl( variables, "hostname", String.valueOf( 1234 ), "webAppName", "?param=value" ) ); Assert.assertEquals( "http: HttpUtil.constructUrl( variables, "hostname", String.valueOf( 1234 ), "webAppName", "?param=value", false ) ); Assert.assertEquals( "https: HttpUtil.constructUrl( variables, "hostname", String.valueOf( 1234 ), "webAppName", "?param=value", true ) ); }