static void checkReturnedPartitions(List<? extends PartitionId> partitionIds,
      List<PartitionRangeCheckParams> checkParamsList) {
    int expectedPartitionCount = 0;
    for (PartitionRangeCheckParams checkParams : checkParamsList) {
      expectedPartitionCount += checkParams.count;
    }
    assertEquals("Returned partition count not as expected", expectedPartitionCount, partitionIds.size());
    for (PartitionId partitionId : partitionIds) {
      int partId = Integer.parseInt(partitionId.toPathString());
      PartitionRangeCheckParams selectedCheckParams = null;
      for (PartitionRangeCheckParams checkParams : checkParamsList) {
        if (partId >= checkParams.rangeStart && partId <= checkParams.rangeEnd) {
          selectedCheckParams = checkParams;
          break;
        }
      }
      assertNotNull("Partition ID [" + partId + "] is not in any of the specified ranges", selectedCheckParams);
      assertEquals("Partition class not as expected", selectedCheckParams.expectedClass,
          partitionId.getPartitionClass());
      assertEquals("Partition state not as expected", selectedCheckParams.expectedState,
          partitionId.getPartitionState());
    }
  }
Checks that each of the partitions in {@code partitionIds} belongs to one of the ranges defined by
{@code checkParamsList}.
@param partitionIds the partitions to check.
@param checkParamsList the list of ranges/types that the partitions in {@code partitionIds} can belong to.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java