@Test
  public void testSerialization() throws Exception {
    SchemaNode root = generateSchemaTree();
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    root.serialize(outputStream);

    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ISchemaTree schemaTree = ClusterSchemaTree.deserialize(inputStream);

    Pair<List<MeasurementPath>, Integer> visitResult =
        schemaTree.searchMeasurementPaths(new PartialPath("root.sg.**.status"), 2, 1, true);
    Assert.assertEquals(2, visitResult.left.size());
    Assert.assertEquals(3, (int) visitResult.right);

    testSearchDeviceInfo(schemaTree);
  }
Generate complex schemaengine tree with specific deep and width. For example, if deep=2 and
width=3, the schemaengine tree contains timeseries: root.d0.s, root.d1.s, root.s2.s,
root.d0.d0.s, root.d0.d1.s, root.d0.d2.s, root.d1.d0.s, root.d1.d1.s, root.d1.d2.s,
root.d2.d0.s, root.d2.d1.s, root.d2.d2.s

@param deep deep
@param width width
@return root node
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/common/schematree/ClusterSchemaTreeTest.java