### Question:
CorsUtil { public static String sanitizeDefaultPort(String url) { int afterSchemeIndex = url.indexOf(": if(afterSchemeIndex < 0) { return url; } String scheme = url.substring(0, afterSchemeIndex); int fromIndex = scheme.length() + 3; int ipv6StartIndex = url.indexOf('[', fromIndex); if (ipv6StartIndex > 0) { fromIndex = url.indexOf(']', ipv6StartIndex); } int portIndex = url.indexOf(':', fromIndex); if(portIndex >= 0) { int port = Integer.parseInt(url.substring(portIndex + 1)); if(isDefaultPort(port, scheme)) { return url.substring(0, portIndex); } } return url; }  static boolean isCoreRequest(HeaderMap headers); static String matchOrigin(HttpServerExchange exchange, Collection<String> allowedOrigins); static String defaultOrigin(HttpServerExchange exchange); static String sanitizeDefaultPort(String url); static boolean isPreflightedRequest(HttpServerExchange exchange);  }### Answer:
@Test public void testSanitizeDefaultPort() { String url = "http: assertThat(CorsUtil.sanitizeDefaultPort(url), is("http: url = "http: assertThat(CorsUtil.sanitizeDefaultPort(url), is("http: url = "http: assertThat(CorsUtil.sanitizeDefaultPort(url), is("http: url = "http: assertThat(CorsUtil.sanitizeDefaultPort(url), is("http: url = "https: assertThat(CorsUtil.sanitizeDefaultPort(url), is("https: url = "https: assertThat(CorsUtil.sanitizeDefaultPort(url), is("https: url = "https: assertThat(CorsUtil.sanitizeDefaultPort(url), is("https: url = "http: assertThat(CorsUtil.sanitizeDefaultPort(url), is("http: url = "http: assertThat(CorsUtil.sanitizeDefaultPort(url), is("http: }