@Test
public void testCombineMetadataInStrings() {

  MTree root = new MTree();
  MTree root1 = new MTree();
  MTree root2 = new MTree();
  MTree root3 = new MTree();
  try {
    CompressionType compressionType = TSFileDescriptor.getInstance().getConfig().getCompressor();
    root.setStorageGroup(new PartialPath("root.a.d0"));
    root.createTimeseries(new PartialPath("root.a.d0.s0"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root.createTimeseries(new PartialPath("root.a.d0.s1"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root.setStorageGroup(new PartialPath("root.a.d1"));
    root.createTimeseries(new PartialPath("root.a.d1.s0"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root.createTimeseries(new PartialPath("root.a.d1.s1"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root.setStorageGroup(new PartialPath("root.a.b.d0"));
    root.createTimeseries(new PartialPath("root.a.b.d0.s0"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root1.setStorageGroup(new PartialPath("root.a.d0"));
    root1.createTimeseries(new PartialPath("root.a.d0.s0"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root1.createTimeseries(new PartialPath("root.a.d0.s1"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root2.setStorageGroup(new PartialPath("root.a.d1"));
    root2.createTimeseries(new PartialPath("root.a.d1.s0"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root2.createTimeseries(new PartialPath("root.a.d1.s1"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    root3.setStorageGroup(new PartialPath("root.a.b.d0"));
    root3.createTimeseries(new PartialPath("root.a.b.d0.s0"), TSDataType.valueOf("INT32"),
        TSEncoding.valueOf("RLE"), compressionType, Collections.emptyMap(), null);
    String[] metadatas = new String[3];
    metadatas[0] = root1.toString();
    metadatas[1] = root2.toString();
    metadatas[2] = root3.toString();
    assertEquals(MTree.combineMetadataInStrings(metadatas), root.toString());
  } catch (MetadataException e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
}