private boolean hasDeleteUnsupportedServicesAction(UpgradePack upgradePack) {
    return upgradePack.getAllGroups().stream()
      .filter(ClusterGrouping.class::isInstance)
      .flatMap(group -> ((ClusterGrouping) group).executionStages.stream())
      .map(executeStage -> executeStage.task)
      .anyMatch(this::isDeleteUnsupportedTask);
  }
The {@link ComponentsExistInRepoCheck} is used to determine if any of the
components scheduled for upgrade do not exist in the target repository or
stack.
ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsExistInRepoCheck.java