public Optional<String> getIPAddr() {
        if (this == DiscoveryResult.EMPTY) {
            return Optional.empty();
        }
        if (server.getInstanceInfo() != null) {
            String ip = server.getInstanceInfo().getIPAddr();
            if (ip != null && !ip.isEmpty()) {
                return Optional.of(ip);
            }
            return Optional.empty();
        }
        return Optional.empty();
    }
@Test
    void ipAddrEmptyForIncompleteInstanceInfo() {
        final InstanceInfo instanceInfo = Builder.newBuilder()
                .setAppName("ipAddrMissing")
                .setHostName("ipAddrMissing")
                .setPort(7777)
                .build();

        final DiscoveryEnabledServer server = new DiscoveryEnabledServer(instanceInfo, false);
        final DynamicServerListLoadBalancer<Server> lb =
                new DynamicServerListLoadBalancer<>(new DefaultClientConfigImpl());
        final DiscoveryResult result = new DiscoveryResult(server, lb.getLoadBalancerStats());

        Truth.assertThat(result.getIPAddr()).isEqualTo(Optional.empty());
    }