void waitForPartitionAssignments(KafkaCollector collector) throws Exception {
    long consumersWithAssignments = 0;
    while (consumersWithAssignments < collector.kafkaWorkers.streams) {
      Thread.sleep(10);
      consumersWithAssignments =
        collector
          .kafkaWorkers
          .workers
          .stream()
          .filter(w -> !w.assignedPartitions.get().isEmpty())
          .count();
    }
  }
Wait until all kafka consumers created by the collector have at least one partition assigned.
zipkin-collector/kafka/src/test/java/zipkin2/collector/kafka/ITKafkaCollector.java