private void ensureSingleCluster() {
        if (isEmpty()) return;

        if (stream().anyMatch(node -> node.allocation().isEmpty()))
            throw new IllegalStateException("Some nodes are not allocated to a cluster");

        ClusterSpec firstNodeSpec = first().get().allocation().get().membership().cluster().with(Optional.empty());
        if (stream().map(node -> node.allocation().get().membership().cluster().with(Optional.empty()))
                    .anyMatch(clusterSpec -> ! clusterSpec.id().equals(firstNodeSpec.id())))
            throw new IllegalStateException("Nodes belong to multiple clusters");
    }
Returns the number of unused IP addresses in the pool, assuming any and all unaccounted for hostnames
in the pool are resolved to exactly 1 IP address (or 2 if dual-stack).
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeList.java