private Map<String, Set<String>> getReservedHostNamesByHostGroupName(Collection<TopologyHostGroupEntity> hostGroups) {
    Map<String, Set<String>> reservedHostNamesByHostGroups = new HashMap<>();

    for (TopologyHostGroupEntity hostGroupEntity: hostGroups) {
      String hostGroupName = hostGroupEntity.getName();

      if ( !reservedHostNamesByHostGroups.containsKey(hostGroupName) )
        reservedHostNamesByHostGroups.put(hostGroupName, new HashSet<>());

      for (TopologyHostInfoEntity hostInfoEntity: hostGroupEntity.getTopologyHostInfoEntities()) {
        if (StringUtils.isNotEmpty(hostInfoEntity.getFqdn())) {
          reservedHostNamesByHostGroups.get(hostGroupName).add(hostInfoEntity.getFqdn());
        }
      }
    }
    return reservedHostNamesByHostGroups;
  }
Returns a map where the keys are the host group names and the values the
collection of FQDNs the hosts in the host group
@param hostGroups
@return
ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java