### Question:
MetricsOptions { public List<String> getMetricsHostAllowlist() { return metricsHostAllowlist; }  boolean isMetricsEnabled(); int getMetricsPort(); String getMetricsInterface(); List<String> getMetricsCategories(); List<String> getMetricsHostAllowlist(); static final ImmutableSet<MetricCategory> DEFAULT_METRICS_CATEGORIES; }### Answer:
@Test public void metricsHostAllowlist_shouldNotRequireAValue() { final GlobalConfiguration globalConfiguration = getGlobalConfigurationFromArguments("--metrics-host-allowlist"); assertThat(globalConfiguration.getMetricsHostAllowlist()).isEmpty(); }
@Test public void metricsHostAllowlist_shouldSupportAllowingMultipleHosts() { final GlobalConfiguration globalConfiguration = getGlobalConfigurationFromArguments("--metrics-host-allowlist", "my.host,their.host"); assertThat(globalConfiguration.getMetricsHostAllowlist()).containsOnly("my.host", "their.host"); }
@Test public void metricsHostAllowlist_shouldSupportAllowingAllHosts() { final GlobalConfiguration globalConfiguration = getGlobalConfigurationFromArguments("--metrics-host-allowlist", "*"); assertThat(globalConfiguration.getMetricsHostAllowlist()).containsOnly("*"); }
@Test public void metricsHostAllowlist_shouldDefaultToLocalhost() { assertThat(getGlobalConfigurationFromArguments().getMetricsHostAllowlist()) .containsOnly("localhost", "127.0.0.1"); }