### Question:
ConfigBasedJmxHostProvider implements JMXHostProvider { @Override public Set<String> getHostNames(String clusterName, String componentName) { return overridenJmxUri(componentName) .map(uri -> singleton(resolve(uri, clusterName).getHost())) .orElseGet(() -> defaultProvider.getHostNames(clusterName, componentName)); } ConfigBasedJmxHostProvider(Map<String, UriInfo> overriddenJmxUris, JMXHostProvider defaultProvider, ConfigHelper configHelper); @Override String getPublicHostName(String clusterName, String hostName); @Override Set<String> getHostNames(String clusterName, String componentName); @Override String getPort(String clusterName, String componentName, String hostName, boolean httpsEnabled); @Override String getJMXProtocol(String clusterName, String componentName); @Override String getJMXRpcMetricTag(String clusterName, String componentName, String port);  }### Answer:
@Test public void testDelegatesWhenHostIsNotOverridden() throws Exception { expect(defaultHostProvider.getHostNames(CLUSTER_1, COMPONENT_WITHOUT_OVERRIDDEN_HOST)).andReturn(resolvedUris).anyTimes(); replayAll(); assertThat(hostProvider.getHostNames(CLUSTER_1, COMPONENT_WITHOUT_OVERRIDDEN_HOST), is(resolvedUris)); verifyAll(); }