private static void addMappingToMap(Map<String, List<String>> map, WMMapping mapping) {
      List<String> list = map.get(mapping.getEntityType());
      if (list == null) {
        list = new ArrayList<>();
        map.put(mapping.getEntityType(), list);
      }
      list.add(mapping.getEntityName());
    }
A n-ary tree for the pools, each node contains a pool and its children.
ql/src/java/org/apache/hadoop/hive/ql/ddl/workloadmanagement/resourceplan/show/formatter/ShowResourcePlanFormatter.java