### Question:
BatchPluginResource implements DownloadableResource, PluginResource, BatchResource { public static BatchPluginResource parse(String url, final Map<String, String> queryParams) throws UrlParseException { final int startIndex = url.indexOf(URL_PREFIX) + URL_PREFIX.length() + 1; if (url.indexOf('?') != -1) { url = url.substring(0, url.indexOf('?')); } final String typeAndModuleKey = url.substring(startIndex); final String[] parts = typeAndModuleKey.split("/", 2); if (parts.length < 2) { throw new UrlParseException("Could not parse invalid batch resource url: " + url); } final String moduleKey = parts[0]; final String resourceName = parts[1]; final String type = resourceName.substring(resourceName.lastIndexOf('.') + 1); return new BatchPluginResource(resourceName, moduleKey, type, queryParams); } BatchPluginResource(final String moduleCompleteKey, final String type, final Map<String, String> params); private  BatchPluginResource(final String resourceName, final String moduleCompleteKey, final String type, final Map<String, String> params); boolean isEmpty(); void add(final DownloadableResource resource); boolean isResourceModified(final HttpServletRequest request, final HttpServletResponse response); void serveResource(final HttpServletRequest request, final HttpServletResponse response); void streamResource(final OutputStream out); String getContentType(); static BatchPluginResource parse(String url, final Map<String, String> queryParams); static boolean matches(final String url); String getUrl(); String getResourceName(); Map<String, String> getParams(); String getVersion(WebResourceIntegration integration); String getModuleCompleteKey(); boolean isCacheSupported(); String getType(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testParse() throws Exception { final BatchPluginResource resource = BatchPluginResource.parse("/download/batch/test.plugin:webresources/test.plugin:webresources.css", Collections.<String, String>emptyMap()); assertEquals("css", resource.getType()); assertEquals("test.plugin:webresources", resource.getModuleCompleteKey()); final Map<String, String> params = resource.getParams(); assertEquals(0, params.size()); }
@Test(expected = UrlParseException.class) public void testParseInvlaidUrlThrowsException() throws UrlParseException { BatchPluginResource.parse("/download/batch/blah.css", Collections.<String, String>emptyMap()); }