public <T> List<T> getAll(Class<T> clazz) {
    List<T> ret = new ArrayList<>();
    for (EquivGroup g : groups) {
      ret.addAll(g.getAll(clazz));
    }
    return ret;
  }
Links and optionally merges the groups identified by the two objects.
ql/src/java/org/apache/hadoop/hive/ql/plan/mapper/PlanMapper.java