code: private static void populateMultiPartitionWorkUnit(List<KafkaPartition> partitions, WorkUnit workUnit) {
      Preconditions.checkArgument(!partitions.isEmpty(), "There should be at least one partition");
      GobblinMetrics.addCustomTagToState(workUnit, new Tag<>("kafkaTopic", partitions.get(0).getTopicName()));
      for (int i = 0; i < partitions.size(); i++) {
        workUnit.setProp(KafkaUtils.getPartitionPropName(KafkaSource.PARTITION_ID, i), partitions.get(i).getId());
        workUnit.setProp(KafkaUtils.getPartitionPropName(KafkaSource.LEADER_ID, i),
            partitions.get(i).getLeader().getId());
        workUnit.setProp(KafkaUtils.getPartitionPropName(KafkaSource.LEADER_HOSTANDPORT, i),
            partitions.get(i).getLeader().getHostAndPort());
      }
    }
docs: Add a list of partitions of the same topic to a {@link WorkUnit}.