### Question:
NetworkConfigurationManagerImpl implements NetworkConfigurationManager { @Override public boolean isExcludedFromProxy(final String host) { Set<String> exclusionPatterns; if (getSelectedProxyType() == ConfigurationType.SYSTEM) { exclusionPatterns = getSystemConfiguration().getExclusionPatterns(); } else if (getSelectedProxyType() == ConfigurationType.MANUAL) { exclusionPatterns = getManualConfiguration().getExclusionPatterns(); } else { exclusionPatterns = Collections.emptySet(); } for (final String exclusion : exclusionPatterns) { final String[] splitOnStar = exclusion.split("\\*", -1); final String pattern = "\\Q" + StringUtilities.join("\\E.*\\Q", splitOnStar) + "\\E"; if (Pattern.matches(pattern, host)) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(StringUtilities.concat("Host [", host, "] matches proxy exclusion pattern [", exclusion, "]; not using proxy.")); } return true; } } return false; } NetworkConfigurationManagerImpl(final PreferencesRegistry prefsRegistry); @Override void addChangeListener(final NetworkConfigurationChangeListener listener); @Override void persistConfiguration(); @Override ConfigurationType getSelectedProxyType(); @Override void setSelectedProxyType(final ConfigurationType configurationType); @Override NoProxyConfiguration getNoProxyConfiguration(); @Override SystemProxyConfiguration getSystemConfiguration(); @Override UrlProxyConfiguration getUrlConfiguration(); @Override ManualProxyConfiguration getManualConfiguration(); @Override boolean isExcludedFromProxy(final String host); @Override void removeChangeListener(final NetworkConfigurationChangeListener listener); @Override void restoreDefaults(); @Override boolean isNetworkMonitorEnabled(); @Override void setNetworkMonitorEnabled(final boolean networkMonitorEnabled); @Override BooleanProperty networkMonitorEnabledProperty();  }### Answer:
@Test public void testIsExcludedFromProxy() { Assert.assertFalse(isExcluded("", ourHost)); Assert.assertFalse(isExcluded("*x", ourHost)); Assert.assertFalse(isExcluded("x*", ourHost)); Assert.assertFalse(isExcluded("x", ourHost)); Assert.assertTrue(isExcluded("test*", ourHost)); Assert.assertTrue(isExcluded("*host", ourHost)); Assert.assertTrue(isExcluded("test*host", ourHost)); Assert.assertTrue(isExcluded("*", ourHost)); }