public boolean anyGroupTaskMatch(Predicate<Task> taskPredicate) {
    return getAllGroups().stream()
      .filter(ClusterGrouping.class::isInstance)
      .flatMap(group -> ((ClusterGrouping) group).executionStages.stream())
      .map(executeStage -> executeStage.task)
      .anyMatch(taskPredicate);
  }
@return true if this upgrade pack contains a group with a task that matches the given predicate
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java