### Question:
DelegatingDnsResolver implements DnsResolver { @Override public InetAddress[] resolve(String host) throws UnknownHostException { return delegate.resolve(host); } DelegatingDnsResolver(com.ibm.cloud.objectstorage.DnsResolver delegate); @Override InetAddress[] resolve(String host);  }### Answer:
@Test public void testDelegatingDnsResolverCallsResolveOnDelegate() throws Exception { final AtomicInteger timesCalled = new AtomicInteger(); DnsResolver delegate = new DnsResolver() { @Override public InetAddress[] resolve(String host) throws UnknownHostException { timesCalled.incrementAndGet(); return new InetAddress[0]; } }; org.apache.http.conn.DnsResolver resolver = new DelegatingDnsResolver(delegate); resolver.resolve("localhost"); assertEquals("Delegate Resolver should have been executed", 1, timesCalled.get()); }