class ChainedHostResolver implements AdvancedHostResolver {

    @Override
    public Collection<InetAddress> resolve(String host) {
        readLock.lock();
        try {
            // attempt to resolve the host using all resolvers. returns the results from the first successful resolution.
            return resolvers.stream()
                    .map(resolver -> resolver.resolve(host))
                    .filter(results -> !results.isEmpty())
                    .findFirst()
                    .orElse(emptyList());

            // no resolvers returned results
        } finally {
            readLock.unlock();
        }
    }

    public  ChainedHostResolver(Collection<? extends AdvancedHostResolver> resolvers);

}