private NodeCandidate assignGroupToNewNode(NodeCandidate candidate, int[] countInGroup) {
        if (candidate.state() == Node.State.active && candidate.allocation().get().membership().retired()) return candidate;
        if (candidate.state() == Node.State.active && candidate.allocation().get().membership().cluster().group().isPresent()) return candidate;
        return inFirstGroupWithDeficiency(candidate, countInGroup);
    }
Assign a group to new or to be reactivated nodes.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupAssigner.java