private Predicate createPredicate(Map<Resource.Type, String> keyValueMap, Predicate predicate) {
    Predicate internalPredicate = createInternalPredicate(keyValueMap);

    if (internalPredicate == null) {
        return predicate;
    }
    return (predicate == null ? internalPredicate :
          new AndPredicate(predicate, internalPredicate));
  }
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