private void addSkippedPriorities(List<String> priorities, Map<String, Set<String>> skippedPriorites, Set<String> prioritiesJustAdded) {
    for (String priority : prioritiesJustAdded) {
      if (skippedPriorites.containsKey(priority)) {
        Set<String> prioritiesToAdd = skippedPriorites.remove(priority);
        addPriorities(priorities, prioritiesToAdd, priority);
        addSkippedPriorities(priorities, skippedPriorites, prioritiesToAdd);
      }
    }
  }
Add the skipped priorities if the services they are supposed to come after have been added
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ServiceCheckGrouping.java