private Optional<Result> checkIfOtherNodesHaveWantedState(StorageNodeInfo nodeInfo, String newDescription, ClusterState clusterState) {
        Node node = nodeInfo.getNode();

        Set<Integer> groupsWithNodesWantedStateNotUp = groupsWithUserWantedStateNotUp();
        if (groupsWithNodesWantedStateNotUp.size() == 0) {
            log.log(FINE, "groupsWithNodesWantedStateNotUp=0");
            return Optional.empty();
        }

        Set<Integer> groupsWithSameStateAndDescription = groupsWithSameStateAndDescription(MAINTENANCE, newDescription);
        if (aGroupContainsNode(groupsWithSameStateAndDescription, node)) {
            log.log(FINE, "Node is in group with same state and description, allow");
            return Optional.of(allow());
        }
        // There are groups with nodes not up, but with another description, probably operator set
        if (groupsWithSameStateAndDescription.size() == 0) {
            return Optional.of(disallow("Wanted state already set for another node in groups: " +
                                        sortSetIntoList(groupsWithNodesWantedStateNotUp)));
        }

        Set<Integer> retiredAndNotUpGroups = groupsWithNotRetiredAndNotUp(clusterState);
        int numberOfGroupsToConsider = retiredAndNotUpGroups.size();
        // Subtract one group if node is in a group with nodes already retired or not up, since number of such groups will
        // not increase if we allow node to go down
        if (aGroupContainsNode(retiredAndNotUpGroups, node)) {
            numberOfGroupsToConsider = retiredAndNotUpGroups.size() - 1;
        }

        var result = checkRedundancy(retiredAndNotUpGroups, clusterState);
        if (result.isPresent() && result.get().notAllowed())
            return result;

        if (numberOfGroupsToConsider < maxNumberOfGroupsAllowedToBeDown) {
            log.log(FINE, "Allow, retiredAndNotUpGroups=" + retiredAndNotUpGroups);
            return Optional.of(allow());
        }

        return Optional.of(disallow(String.format("At most %d groups can have wanted state: %s",
                                                  maxNumberOfGroupsAllowedToBeDown,
                                                  sortSetIntoList(retiredAndNotUpGroups))));
    }
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