private int computeNodesSafelySetToMaintenance(Group group) {
            Set<ConfiguredNode> nodesInGroupSafelySetToMaintenance = group.getNodes().stream()
                    .filter(configuredNode -> nodesSafelySetToMaintenance.contains(configuredNode.index()))
                    .collect(Collectors.toSet());

            return nodesInGroupSafelySetToMaintenance.size();
        }
If the number of nodes safely set to maintenance is at least this number, the remaining
nodes in the group will be set to maintenance (storage nodes) or down (distributors).

<p>This feature is disabled if safeMaintenanceGroupThreshold is 0 (not default).</p>
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/GroupAvailabilityCalculator.java