@Override
    public DiscoveryResult resolve(@Nullable Object key) {
        final Server server = loadBalancer.chooseServer(key);
        return server != null
                ? new DiscoveryResult((DiscoveryEnabledServer) server, loadBalancer.getLoadBalancerStats())
                : DiscoveryResult.EMPTY;
    }
@Test
    void properSentinelValueWhenServersUnavailable() {
        final DynamicServerResolver resolver = new DynamicServerResolver(new DefaultClientConfigImpl());

        final DiscoveryResult nonExistentServer = resolver.resolve(null);

        Truth.assertThat(nonExistentServer).isSameInstanceAs(DiscoveryResult.EMPTY);
        Truth.assertThat(nonExistentServer.getHost()).isEqualTo("undefined");
        Truth.assertThat(nonExistentServer.getPort()).isEqualTo(-1);
    }