private void validateAccount(CloudAccount requestedAccount, ApplicationId application, LockedNodeList allNodes) {
        CloudAccount effectiveAccount = requestedAccount.isUnspecified() ? nodeRepository.zone().cloud().account() : requestedAccount;
        List<Node> nodesInOtherAccount = allNodes.owner(application).nodeType(NodeType.tenant).stream()
                                                 .filter(node -> !node.cloudAccount().equals(effectiveAccount))
                                                 .toList();
        if (nodesInOtherAccount.isEmpty()) return;

        SnippetGenerator snippet = new SnippetGenerator();
        String hostnames = nodesInOtherAccount.stream()
                                              .map(Node::hostname)
                                              .collect(Collectors.joining(", "));
        String hostsSnippet = snippet.makeSnippet(hostnames, 100);
        throw new IllegalArgumentException("Cannot allocate nodes in " + requestedAccount + " because " +
                                           application + " has existing nodes in " + nodesInOtherAccount.get(0).cloudAccount() +
                                           ": " + hostsSnippet + ". Deployment must be removed in order to change account");
    }
Ensure sufficient nodes are reserved or active for the given application, group and cluster

@param application        the application we are allocating to
@param cluster            the cluster and group we are allocating to
@param requested          a specification of the requested nodes
@return the list of nodes this cluster group will have allocated if activated
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java