### Question:
URLPathUtils { private static String sanitizeUrl(String url) { if (url != null) { if (url.startsWith(" url = "http:" + url; once(LOGGER).warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url); } else if (url.startsWith("/")) { url = LOCAL_HOST + url; once(LOGGER).info("'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [{}] for server URL [{}]", LOCAL_HOST, url); } else if (!url.matches("[a-zA-Z][0-9a-zA-Z.+\\-]+: url = "http: once(LOGGER).warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url); } } return url; }  static URL getServerURL(OpenAPI openAPI, Map<String, String> userDefinedVariables); static URL getServerURL(final Server server, final Map<String, String> userDefinedVariables); static String getScheme(OpenAPI openAPI, CodegenConfig config); static String getScheme(URL url, CodegenConfig config); static String getPort(URL url, int defaultPort); static String getPort(URL url, String defaultPort); static String getPath(URL url, String defaultPath); static String getProtocolAndHost(URL url); static String getHost(OpenAPI openAPI, final Map<String, String> userDefinedVariables); static final String LOCAL_HOST; static final Pattern VARIABLE_PATTERN; }### Answer:
@Test public void testSanitizeUrl() { String[][] testData = { { "https: { "HTTPS: { "http: { "HTTP: { " { "abc6.xyz:9999/some/path", "http: { "localhost:9000/api", "http: { "/some/path", "http: for (String[] t:testData) { OpenAPI openAPI = new OpenAPI(); openAPI.addServersItem(new Server().url(t[0])); Assert.assertEquals(URLPathUtils.getServerURL(openAPI, null).toString(), t[1]); } }