@Test
  public void testGetDatabasePathByLevel() {
    int level = 1;
    try {
      assertEquals(
          "root.laptop",
          MetaUtils.getDatabasePathByLevel(new PartialPath("root.laptop.d1.s1"), level)
              .getFullPath());
    } catch (MetadataException e) {
      e.printStackTrace();
      fail(e.getMessage());
    }

    boolean caughtException = false;
    try {
      MetaUtils.getDatabasePathByLevel(new PartialPath("root1.laptop.d1.s1"), level);
    } catch (MetadataException e) {
      caughtException = true;
      assertEquals(
          "root1.laptop.d1.s1 is not a legal path, because it does not start with root",
          e.getMessage());
    }
    assertTrue(caughtException);

    caughtException = false;
    try {
      MetaUtils.getDatabasePathByLevel(new PartialPath("root"), level);
    } catch (MetadataException e) {
      caughtException = true;
      assertEquals(
          "root is not a legal path, because it is no longer than default sg level: 1",
          e.getMessage());
    }
    assertTrue(caughtException);
  }
TODO: remove this after delete {@linkplain MetaUtils#groupAlignedPaths}
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/MetaUtilsTest.java