private HiveMetaHookLoader getHookLoader() {
    HiveMetaHookLoader hookLoader = new HiveMetaHookLoader() {
      @Override
      public HiveMetaHook getHook(
          org.apache.hadoop.hive.metastore.api.Table tbl)
          throws MetaException {
        return null;
      }
    };
    return hookLoader;
  }
This method checks if persistence manager cache is cleaned up properly under some circumstances.
There is a chance that cleanup process removes elements created not only by this test, so we don't check
exact equality, instead check that no new elements can be seen in the cache (so newSet.removeAll(oldSet) should be empty).
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java