public static String toJSON(Predicate predicate) {
    return (predicate == null) ? null : predicate.toJSON();
  }
Safely serializes the specified {@link Predicate} to a JSON-formatted {@link String}

@param predicate the {@link Predicate} to process
@return a {@link String} or null of the supplied predicate is null
ambari-server/src/main/java/org/apache/ambari/server/collections/PredicateUtils.java