private Optional<Result> checkRedundancy(Set<Integer> retiredAndNotUpGroups, ClusterState clusterState) {
        Set<Integer> indexesToCheck = new HashSet<>();
        retiredAndNotUpGroups.forEach(index -> getNodesInGroup(index).forEach(node -> indexesToCheck.add(node.index())));

        for (var distributorNodeInfo : clusterInfo.getDistributorNodeInfos()) {
            if (clusterState.getNodeState(distributorNodeInfo.getNode()).getState() != UP) continue;

            var r = checkRedundancySeenFromDistributor(distributorNodeInfo, indexesToCheck);
            if (r.notAllowed())
                return Optional.of(r);
        }
        return Optional.empty();
    }
Returns an optional Result, where return value is:
- No wanted state for other nodes, return Optional.empty
- Wanted state for nodes/groups are not UP:
- if less than maxNumberOfGroupsAllowedToBeDown: return Optional.of(allowed)
     else: if node is in group with nodes already down: return Optional.of(allowed), else Optional.of(disallowed)
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java