private static void toSlime(Application application,
                                NodeList applicationNodes,
                                NodeRepository nodeRepository,
                                Cursor object,
                                URI applicationUri) {
        object.setString("url", applicationUri.toString());
        object.setString("id", application.id().toFullString());
        Version version = applicationNodes.stream()
                                          .map(node -> node.status().vespaVersion()
                                                           .orElse(node.allocation().get().membership().cluster().vespaVersion()))
                                          .min(Comparator.naturalOrder())
                                          .orElse(Vtag.currentVersion);
        object.setString("version", version.toFullString());
        object.setString("cloudAccount", applicationNodes.stream().findFirst().map(Node::cloudAccount).orElse(CloudAccount.empty).value());
        clustersToSlime(application, applicationNodes, nodeRepository, object.setObject("clusters"));
    }
Serializes application information for nodes/v2/application responses

@author bratseth
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/ApplicationSerializer.java