public ClusterResources toResources() {
        ensureSingleCluster();
        if (isEmpty()) return new ClusterResources(0, 0, NodeResources.unspecified());
        return new ClusterResources(size(),
                                    (int)stream().map(node -> node.allocation().get().membership().cluster().group().get())
                                                 .distinct()
                                                 .count(),
                                    first().get().resources());
    }
Returns the resources of the nodes of this.

NOTE: If the nodes do not all have the same values of node resources, a random pick among those node resources
      will be returned.

@throws IllegalStateException if the nodes in this do not all belong to the same cluster
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java