### Question:
SwaggerUiResourceLocator { public URL locate(String resourcePath) throws MalformedURLException { if (StringUtils.isEmpty(resourcePath) || "/".equals(resourcePath)) { resourcePath = "index.html"; } if (resourcePath.startsWith("/")) { resourcePath = resourcePath.substring(1); } URL ret; try { ret = URI.create(swaggerUiRoot + resourcePath).toURL(); } catch (IllegalArgumentException ex) { throw new MalformedURLException(ex.getMessage()); } return ret; } SwaggerUiResourceLocator(String swaggerUiRoot); URL locate(String resourcePath); boolean exists(String resourcePath);  }### Answer:
@Test(expected = MalformedURLException.class) public void testLocateWithBadCharactersInUrl() throws MalformedURLException { String url = "jar:file:/Volumes/bigdrive/test157/jetty/base/webapps/" + "Rhythmyx/WEB-INF/lib/swagger-ui-2.2.10-1.jar!/META-INF/resources/" + "webjars/swagger-ui/2.2.10-1/assets/by-path + "Screen Shot 2020-02-05 at 10.50.53 AM.png"; SwaggerUiResourceLocator locator = new SwaggerUiResourceLocator("/"); locator.locate(url); }