private void checkPathPatternTree(
      List<PartialPath> paths,
      List<PartialPath> compressedPaths,
      List<PartialPath> compressedDevicePaths,
      boolean useWildcard)
      throws IOException {
    PathPatternTree patternTree = new PathPatternTree(useWildcard);
    for (PartialPath path : paths) {
      patternTree.appendPathPattern(path);
    }
    patternTree.constructTree();

    Assert.assertEquals(
        compressedPaths.stream().sorted().collect(Collectors.toList()),
        patternTree.getAllPathPatterns().stream().sorted().collect(Collectors.toList()));

    PathPatternTree resultPatternTree = new PathPatternTree();
    for (PartialPath path : compressedPaths) {
      resultPatternTree.appendPathPattern(path);
    }
    resultPatternTree.constructTree();

    Assert.assertEquals(resultPatternTree, patternTree);

    Assert.assertEquals(
        compressedDevicePaths.stream()
            .map(PartialPath::getFullPath)
            .sorted()
            .collect(Collectors.toList()),
        patternTree.getAllDevicePatterns().stream()
            .map(Object::toString)
            .sorted()
            .collect(Collectors.toList()));

    Assert.assertEquals(
        compressedDevicePaths.stream().sorted().collect(Collectors.toList()),
        patternTree.getAllDevicePaths().stream().sorted().collect(Collectors.toList()));

    ByteBuffer buffer = resultPatternTree.serialize();
    PathPatternTree tmpPathPatternTree = PathPatternTree.deserialize(buffer);
    Assert.assertEquals(resultPatternTree, tmpPathPatternTree);
  }
@param paths PartialPath list to create PathPatternTree
@param compressedPaths Expected PartialPath list of getAllPathPatterns
@param compressedDevicePaths Expected PartialPath list of getAllDevicePatterns
@throws IOException
iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/path/PathPatternTreeTest.java