public Collection<Set<T>> getEquivalentClasses() {
    // map from root element to all element in the tree
    Map<T, Set<T>> rootToTreeElements = new LinkedHashMap<>();
    for (Map.Entry<T, Entry<T>> entry : map.entrySet()) {
      T node = entry.getKey();
      T root = findInternal(node);
      rootToTreeElements.computeIfAbsent(root, unused -> new LinkedHashSet<>());
      rootToTreeElements.get(root).add(node);
    }
    return rootToTreeElements.values();
  }
@return <tt>true</tt> if the specified equivalence is new
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/utils/DisjointSet.java