public List<PartialPath> getAllDevicePaths() {
    List<String> nodes = new ArrayList<>();
    Set<List<String>> resultNodesSet = new HashSet<>();
    searchDevicePath(root, nodes, resultNodesSet);

    Set<PartialPath> resultPaths = new HashSet<>();
    for (List<String> resultNodes : resultNodesSet) {
      resultPaths.add(new PartialPath(resultNodes.toArray(new String[0])));
    }
    return new ArrayList<>(resultPaths);
  }
Construct tree according to the pathPatternList.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PathPatternTree.java