public Set<String> getHosts() {
    Set<String> hosts = new HashSet<>();
    for (TaskWrapper tw : tasks) {
      hosts.addAll(tw.getHosts());
    }

    return hosts;
  }
@return the set of hosts for all tasks
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/StageWrapper.java