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

    if (out != null) {
      out.println(STAGE_DEPENDENCIES + ":");
    }

    JSONObject json = jsonOutput ? new JSONObject(new LinkedHashMap<>()) : null;
    for (Task task : tasks) {
      JSONObject jsonOut = outputDependencies(task, out, json, jsonOutput, appendTaskType, 2);
      if (jsonOutput && jsonOut != null) {
        json.put(task.getId(), jsonOut);
      }
    }

    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