private void assertTableMetas(List<TableMeta> fullExpected, List<TableMeta> actual, int... expected) {
    assertEquals("Expected " + expected.length + " but have " + actual.size() +
        " tableMeta(s)", expected.length, actual.size());

    Set<TableMeta> metas = new HashSet<>(actual);
    for (int i : expected){
      assertTrue("Missing " + fullExpected.get(i) + "" + actual, metas.remove(fullExpected.get(i)));
    }

    assertTrue("Unexpected tableMeta(s): " + metas, metas.isEmpty());

  }
API tests for HMS client's getTableMeta method.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestGetTableMeta.java