@Nullable
    private static Endpoint toEndpoint(HealthService healthService) {
        if (healthService.service == null) {
            return null;
        }
        if (healthService.node == null) {
            return null;
        }

        assert healthService.service != null;
        assert healthService.node != null;

        if (!Strings.isNullOrEmpty(healthService.service.address)) {
            return Endpoint.of(healthService.service.address, healthService.service.port);
        } else if (!Strings.isNullOrEmpty(healthService.node.address)) {
            return Endpoint.of(healthService.node.address, healthService.service.port);
        } else {
            return null;
        }
    }
Returns a healthy endpoint list by service name.
consul/src/main/java/com/linecorp/armeria/internal/consul/HealthClient.java