test_class.declarator: assignor = new RoundRobinAssignor()
test_class.modifier: private
test_class.original_string: private RoundRobinAssignor assignor = new RoundRobinAssignor();
test_class.type: RoundRobinAssignor
test_class.var_name: assignor
test_class.file: clients/src/test/java/org/apache/kafka/clients/consumer/RoundRobinAssignorTest.java
test_class.identifier: RoundRobinAssignorTest
test_case.body: @Test
      public void testMultipleConsumersMixedTopics() {
          String topic1 = "topic1";
          String topic2 = "topic2";
          String consumer1 = "consumer1";
          String consumer2 = "consumer2";
          String consumer3 = "consumer3";
  
          Map<String, Integer> partitionsPerTopic = new HashMap<>();
          partitionsPerTopic.put(topic1, 3);
          partitionsPerTopic.put(topic2, 2);
  
          Map<String, List<String>> consumers = new HashMap<>();
          consumers.put(consumer1, Arrays.asList(topic1));
          consumers.put(consumer2, Arrays.asList(topic1, topic2));
          consumers.put(consumer3, Arrays.asList(topic1));
  
          Map<String, List<TopicPartition>> assignment = assignor.assign(partitionsPerTopic, consumers);
          assertEquals(Arrays.asList(
                  new TopicPartition(topic1, 0)), assignment.get(consumer1));
          assertEquals(Arrays.asList(
                  new TopicPartition(topic1, 1),
                  new TopicPartition(topic2, 0),
                  new TopicPartition(topic2, 1)), assignment.get(consumer2));
          assertEquals(Arrays.asList(
                  new TopicPartition(topic1, 2)), assignment.get(consumer3));
      }
test_case.class_method_signature: RoundRobinAssignorTest.testMultipleConsumersMixedTopics()
test_case.full_signature: @Test public void testMultipleConsumersMixedTopics()
test_case.identifier: testMultipleConsumersMixedTopics
test_case.invocations: put put put asList put asList put asList assign assertEquals asList get assertEquals asList get assertEquals asList get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultipleConsumersMixedTopics()
focal_class.file: clients/src/main/java/org/apache/kafka/clients/consumer/RoundRobinAssignor.java
focal_class.identifier: RoundRobinAssignor
focal_class.class_method_signature: RoundRobinAssignor.assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_class.full_signature: @Override public Map<String/* memberId */, List<TopicPartition>> assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_class.identifier: assign
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_class.return: Map<String/* memberId */, List<TopicPartition>>
focal_class.signature: Map<String/* memberId */, List<TopicPartition>> assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_class.class_method_signature: RoundRobinAssignor.allPartitionsSorted(Map<String, Integer> partitionsPerTopic,
          Map<String, List<String>> subscriptions)
focal_class.full_signature: public List<TopicPartition> allPartitionsSorted(Map<String, Integer> partitionsPerTopic,
          Map<String, List<String>> subscriptions)
focal_class.identifier: allPartitionsSorted
focal_class.modifiers: public
focal_class.parameters: (Map<String, Integer> partitionsPerTopic,
          Map<String, List<String>> subscriptions)
focal_class.return: List<TopicPartition>
focal_class.signature: List<TopicPartition> allPartitionsSorted(Map<String, Integer> partitionsPerTopic,
          Map<String, List<String>> subscriptions)
focal_class.class_method_signature: RoundRobinAssignor.name()
focal_class.full_signature: @Override public String name()
focal_class.identifier: name
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String name()
focal_class.superclass: extends AbstractPartitionAssignor
focal_method.body: @Override
      public Map<String/* memberId */, List<TopicPartition>> assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions) {
  
          Map<String, List<TopicPartition>> assignment = new HashMap<>();
          for (String memberId : subscriptions.keySet())
              assignment.put(memberId, new ArrayList<TopicPartition>());
  
          CircularIterator<String/* memberId */> assigner = new CircularIterator<>(Utils.sorted(subscriptions.keySet()/* memberId */));
          for (TopicPartition partition : allPartitionsSorted(partitionsPerTopic, subscriptions)) {
              final String topic = partition.topic();
              while (!subscriptions.get(assigner.peek())
                                   .contains(topic)) {
                  assigner.next();
              }
              assignment.get(assigner.next())
                        .add(partition);
          }
          return assignment;
      }
focal_method.class_method_signature: RoundRobinAssignor.assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_method.full_signature: @Override public Map<String/* memberId */, List<TopicPartition>> assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_method.identifier: assign
focal_method.invocations: keySet put sorted keySet allPartitionsSorted topic contains get peek next add get next
focal_method.modifiers: @Override public
focal_method.parameters: (Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)
focal_method.return: Map<String/* memberId */, List<TopicPartition>>
focal_method.signature: Map<String/* memberId */, List<TopicPartition>> assign(Map<String/* topic */, Integer/*  */> partitionsPerTopic,
          Map<String/* memberId */, List<String/* topic */>> subscriptions)