private Table createTableForTestFilter(String dbName, String tableName, String owner,
    int lastAccessTime, boolean hasSecondParam) throws Exception {

    Map<String, String> tableParams =  new HashMap<>();
    tableParams.put("test_param_1", "hi");
    if(hasSecondParam) {
      tableParams.put("test_param_2", "50");
    }

    Table tbl = new TableBuilder()
        .setDbName(dbName)
        .setTableName(tableName)
        .addCol("name", ColumnType.STRING_TYPE_NAME)
        .addCol("income", ColumnType.INT_TYPE_NAME)
        .addPartCol("ds", ColumnType.STRING_TYPE_NAME)
        .addPartCol("hr", ColumnType.INT_TYPE_NAME)
        .setTableParams(tableParams)
        .setOwner(owner)
        .setLastAccessTime(lastAccessTime)
        .create(client, conf);

    if (isThriftClient) {
      // the createTable() above does not update the location in the 'tbl'
      // object when the client is a thrift client and the code below relies
      // on the location being present in the 'tbl' object - so get the table
      // from the metastore
      tbl = client.getTable(dbName, tableName);
    }
    return tbl;
  }
Tests {@link HiveMetaStoreClient#newSynchronizedClient}.  Does not
actually test multithreading, but does verify that the proxy
at least works correctly.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java