### Question:
UrlFactory { private UrlFactory() {} private  UrlFactory(); static URL getUrl(String urlStr, Request request); static void disconnect(URLConnection connection);  }### Answer:
@Test public void testUrlFactory() throws Exception { URL url = UrlFactory.getUrl("https: Assert.assertEquals(HttpsUrlHandler.HTTPS, url.getProtocol()); Assert.assertTrue(url.openConnection() instanceof HttpUrlConnection); url = UrlFactory.getUrl("HTTP: Assert.assertEquals(HttpUrlHandler.HTTP, url.getProtocol()); Assert.assertTrue(url.openConnection() instanceof HttpUrlConnection); url = UrlFactory.getUrl("sftp: Assert.assertEquals(SftpUrlHandler.PROTOCOL, url.getProtocol()); Assert.assertTrue(url.openConnection() instanceof SftpUrlConnection); url = UrlFactory.getUrl("sftp.3GPP: Assert.assertEquals(Sftp3gppUrlHandler.PROTOCOL, url.getProtocol()); Assert.assertTrue(url.openConnection() instanceof Sftp3gppUrlConnection); }