public JSONObject outputStagePlans(PrintStream out, List<Task> tasks,
      boolean jsonOutput, boolean isExtended)
      throws Exception {

    if (out != null) {
      out.println("STAGE PLANS:");
    }

    JSONObject json = jsonOutput ? new JSONObject(new LinkedHashMap<>()) : null;
    for (Task task : tasks) {
      outputPlan(task, out, json, isExtended, jsonOutput, 2);
    }
    return jsonOutput ? json : null;
  }
use case: we want to print the object in explain only if it is true
how to do : print it unless the following 3 are all true:
1. displayOnlyOnTrue tag is on
2. object is boolean
3. object is false
@param exp
@param val
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java