public Optional<String> getIPAddr() {
        if (this.equals(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();
    }
This convenience method exists for usage in tests. For production usage, please use the constructor linked:

@see DiscoveryResult#DiscoveryResult(DiscoveryEnabledServer, LoadBalancerStats)
zuul-discovery/src/main/java/com/netflix/zuul/discovery/DiscoveryResult.java