private static Set<Map<String, Object>> joinPropertyMaps(Set<Map<String, Object>> propertyMaps1,
                                                           Set<Map<String, Object>> propertyMaps2) {
    Set<Map<String, Object>> propertyMaps = new HashSet<>();

    if (propertyMaps1.isEmpty()) {
      return propertyMaps2;
    }
    if (propertyMaps2.isEmpty()) {
      return propertyMaps1;
    }

    for (Map<String, Object> map1 : propertyMaps1) {
      for (Map<String, Object> map2 : propertyMaps2) {
        Map<String, Object> joinedMap = new HashMap<>(map1);
        joinedMap.putAll(map2);
        propertyMaps.add(joinedMap);
      }
    }
    return propertyMaps;
  }
Merge the tree of query properties returned by the renderer with properties in
the query tree.

@param node   property tree node
@param query  query associated with the property tree node
ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java