### Question:
WFSDataStoreFactory extends AbstractDataStoreFactory { public static URL createGetCapabilitiesRequest(URL host, Version version) { if (host == null) { throw new NullPointerException("null url"); } if (version == null) { throw new NullPointerException("version"); } HTTPProtocol httpUtils = new SimpleHttpProtocol(); Map<String, String> getCapsKvp = new HashMap<String, String>(); getCapsKvp.put("SERVICE", "WFS"); getCapsKvp.put("REQUEST", "GetCapabilities"); getCapsKvp.put("VERSION", version.toString()); URL getcapsUrl; try { getcapsUrl = httpUtils.createUrl(host, getCapsKvp); } catch (MalformedURLException e) { logger.log(Level.WARNING, "Can't create GetCapabilities request from " + host, e); throw new RuntimeException(e); } return getcapsUrl; }  WFSDataStore createDataStore(final Map params); DataStore createNewDataStore(final Map params); String getDescription(); Param[] getParametersInfo(); boolean canProcess(final Map params); String getDisplayName(); boolean isAvailable(); static URL createGetCapabilitiesRequest(URL host, Version version); static URL createGetCapabilitiesRequest(final URL host); static final WFSFactoryParam<URL> URL; static final WFSFactoryParam<Boolean> PROTOCOL; static final WFSFactoryParam<String> USERNAME; static final WFSFactoryParam<String> PASSWORD; static final WFSFactoryParam<String> ENCODING; static final WFSFactoryParam<Integer> TIMEOUT; static final WFSFactoryParam<Integer> BUFFER_SIZE; static final WFSFactoryParam<Boolean> TRY_GZIP; static final WFSFactoryParam<Boolean> LENIENT; static final WFSFactoryParam<Integer> MAXFEATURES; }### Answer:
@SuppressWarnings("nls") @Test public void testCreateCapabilities() throws MalformedURLException, UnsupportedEncodingException { final String parametrizedUrl = "https: URL url = WFSDataStoreFactory.createGetCapabilitiesRequest(new URL(parametrizedUrl)); assertNotNull(url); assertEquals("https", url.getProtocol()); assertEquals("excise.pyr.ec.gc.ca", url.getHost()); assertEquals(8081, url.getPort()); assertEquals("/cgi-bin/mapserv.exe", url.getPath()); String query = url.getQuery(); assertNotNull(query); Map<String, String> kvpMap = new HashMap<String, String>(); String[] kvpPairs = query.split("&"); for (String kvp : kvpPairs) { assertTrue(kvp.indexOf('=') > 0); String[] split = kvp.split("="); String param = split[0]; String value = split[1]; value = URLDecoder.decode(value, "UTF-8"); assertFalse(kvpMap.containsKey(param)); kvpMap.put(param.toUpperCase(), value); } assertEquals("/LocalApps/Mapsurfer/PYRWQMP.map", kvpMap.get("MAP")); assertEquals("GetCapabilities", kvpMap.get("REQUEST")); assertEquals("WFS", kvpMap.get("SERVICE")); assertEquals("1.0.0", kvpMap.get("VERSION")); }