public synchronized QueryResultFormatter add(String key, Object value) {
    List<Object> list = map.get(key);
    if (list != null) {
      list.add(value);
    } else {
      list = new ArrayList<>();
      if (value != null) {
        list.add(value);
      }
      map.put(key, list);
    }
    return this;
  }
After instantiating a formatter add the objects you want to be formatted using this method.
Typically this will be add("result", queryResult)
geode-core/src/main/java/org/apache/geode/management/internal/json/QueryResultFormatter.java