@Override
    public String toString() {
        if (level == Level.application) {
            return "endpoint '" + endpointId() + "' (cluster " + containerId + ") -> " +
                   targets.stream().map(Target::toString).sorted()
                          .collect(Collectors.joining(", "));
        }
        return "endpoint '" + endpointId() + "' (cluster " + containerId + ") -> " +
               targets.stream().map(Target::region).map(RegionName::value).sorted()
                      .collect(Collectors.joining(", "));
    }
Returns a copy of this with targets set to given targets
config-model-api/src/main/java/com/yahoo/config/application/api/Endpoint.java