@Test
  public void testDisposeTableSuccess() {
    createTable();
    ServerTableIdentifier tableIdentifier = serverTableIdentifier();

    // test list tables
    List<TableRuntimeMeta> tableRuntimeMetaListAfterAddTable = persistency.getTableRuntimeMetas();
    List<TableRuntimeMeta> tableRuntimeMetaListForOptimizerGroupAfterAddTable =
        persistency.getTableRuntimeMetasForOptimizerGroup(defaultResourceGroup().getName());
    Assert.assertEquals(1, tableRuntimeMetaListForOptimizerGroupAfterAddTable.size());
    Assert.assertEquals(1, tableRuntimeMetaListAfterAddTable.size());

    tableService().disposeTable(tableIdentifier);
    // test list tables after disposing table
    List<TableRuntimeMeta> tableRuntimeMetaListAfterDropTable = persistency.getTableRuntimeMetas();
    List<TableRuntimeMeta> tableRuntimeMetaListForOptimizerGroupAfterDropTable =
        persistency.getTableRuntimeMetasForOptimizerGroup(defaultResourceGroup().getName());
    Assert.assertEquals(0, tableRuntimeMetaListForOptimizerGroupAfterDropTable.size());
    Assert.assertEquals(0, tableRuntimeMetaListAfterDropTable.size());

    dropTable();
    dropDatabase();
  }
Test synchronization in the anomaly scenario where the tableIdentifier is remained in
persistence and the tableRuntime is remained in memory but iceberg table does not exist.
amoro-ams/src/test/java/org/apache/amoro/server/table/TestSyncTableOfExternalCatalog.java