private List<NodeCandidate> byUnretiringPriority(Collection<NodeCandidate> candidates) {
        return candidates.stream()
                         .sorted(Comparator.comparing(NodeCandidate::wantToRetire)
                                           .thenComparing(n -> n.allocation().get().membership().index()))
                         .toList();
    }
Prefer to unretire nodes we don't want to retire, and otherwise those with lower index
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/GroupAssigner.java