public static Set<String> getEffectiveHosts(List<TaskWrapper> tasks) {
    Set<String> effectiveHosts = new HashSet<>();
    for(TaskWrapper t : tasks) {
      effectiveHosts.addAll(t.getHosts());
    }
    return effectiveHosts;
  }
Given a collection of tasks, get the union of the hosts.
@param tasks Collection of tasks
@return Returns the union of the hosts scheduled to perform the tasks.
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/TaskWrapperBuilder.java