### Question:
MavenSettingsProxyProvider { @VisibleForTesting static boolean areProxyPropertiesSet(String protocol) { return PROXY_PROPERTIES .stream() .anyMatch(property -> System.getProperty(protocol + "." + property) != null); }    }### Answer:
@Test public void testAreProxyPropertiesSet() { Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpHostSet() { System.setProperty("http.proxyHost", "host"); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpsHostSet() { System.setProperty("https.proxyHost", "host"); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpPortSet() { System.setProperty("http.proxyPort", "port"); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpsPortSet() { System.setProperty("https.proxyPort", "port"); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpUserSet() { System.setProperty("http.proxyUser", "user"); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpsUserSet() { System.setProperty("https.proxyUser", "user"); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpPasswordSet() { System.setProperty("http.proxyPassword", "password"); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_httpsPasswordSet() { System.setProperty("https.proxyPassword", "password"); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertTrue(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }
@Test public void testAreProxyPropertiesSet_ignoresHttpNonProxyHosts() { System.setProperty("http.nonProxyHosts", "non proxy hosts"); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("http")); Assert.assertFalse(MavenSettingsProxyProvider.areProxyPropertiesSet("https")); }