public static List<ConsumerGroupPartitionMetadataValue.PartitionMetadata> mkListOfPartitionRacks(int numPartitions) {
        List<ConsumerGroupPartitionMetadataValue.PartitionMetadata> partitionRacks = new ArrayList<>(numPartitions);
        for (int i = 0; i < numPartitions; i++) {
            List<String> racks = new ArrayList<>(Arrays.asList("rack" + i % 4, "rack" + (i + 1) % 4));
            partitionRacks.add(
                new ConsumerGroupPartitionMetadataValue.PartitionMetadata()
                    .setPartition(i)
                    .setRacks(racks)
            );
        }
        return partitionRacks;
    }
Creates a list of values to be added to the record and assigns partitions to racks for testing.

@param numPartitions The number of partitions for the topic.

For testing purposes, the following criteria are used:
     - Number of replicas for each partition: 2
     - Number of racks available to the cluster: 4
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/CoordinatorRecordHelpersTest.java