private void getPartitionsWithNames(List<String> names, int expectedPartitionCount) throws TException {
    GetPartitionsRequest request = getGetPartitionsRequest();
    GetProjectionsSpec projectSpec = request.getProjectionSpec();
    projectSpec.setFieldList(Arrays.asList("sd.location"));
    request.getFilterSpec().setFilterMode(PartitionFilterMode.BY_NAMES);
    request.getFilterSpec().setFilters(names);

    GetPartitionsResponse response = client.getPartitionsWithSpecs(request);
    Assert.assertNotNull(response);
    if (expectedPartitionCount > 0) {
      PartitionSpecWithSharedSD partitionSpecWithSharedSD =
          response.getPartitionSpec().get(0).getSharedSDPartitionSpec();
      Assert.assertNotNull(partitionSpecWithSharedSD);
      Assert.assertEquals("Invalid number of partitions returned", expectedPartitionCount,
          partitionSpecWithSharedSD.getPartitionsSize());
      List<Partition> origPartitions = client.getPartitionsByNames(dbName, tblName, names);
      verifyLocations(origPartitions, partitionSpecWithSharedSD.getSd(), partitionSpecWithSharedSD.getPartitions());
    } else {
      Assert.assertTrue(
          "Partition spec should have been empty since filter doesn't match with any partitions",
          response.getPartitionSpec().isEmpty());
    }
  }
Confirms if the partitionWithoutSD object at partitionWithoutSDSIndex index has all the
projected fields set to values which are same as the ones set in origPartitions
@param projectedFields
@param sharedSD
@param partitionWithoutSDS
@param partitionWithoutSDSIndex
@throws IllegalAccessException
@throws InvocationTargetException
@throws NoSuchMethodException
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestGetPartitionsUsingProjectionAndFilterSpecs.java