test_class.declarator: topicName = "topic"
test_class.modifier: private
test_class.original_string: private String topicName = "topic";
test_class.type: String
test_class.var_name: topicName
test_class.declarator: driver = null
test_class.modifier: private
test_class.original_string: private KStreamTestDriver driver = null;
test_class.type: KStreamTestDriver
test_class.var_name: driver
test_class.file: streams/src/test/java/org/apache/kafka/streams/kstream/internals/KStreamBranchTest.java
test_class.identifier: KStreamBranchTest
test_case.body: @SuppressWarnings("unchecked")
      @Test
      public void testKStreamBranch() {
          KStreamBuilder builder = new KStreamBuilder();
  
          Predicate<Integer, String> isEven = new Predicate<Integer, String>() {
              @Override
              public boolean test(Integer key, String value) {
                  return (key % 2) == 0;
              }
          };
          Predicate<Integer, String> isMultipleOfThree = new Predicate<Integer, String>() {
              @Override
              public boolean test(Integer key, String value) {
                  return (key % 3) == 0;
              }
          };
          Predicate<Integer, String> isOdd = new Predicate<Integer, String>() {
              @Override
              public boolean test(Integer key, String value) {
                  return (key % 2) != 0;
              }
          };
  
          final int[] expectedKeys = new int[]{1, 2, 3, 4, 5, 6};
  
          KStream<Integer, String> stream;
          KStream<Integer, String>[] branches;
          MockProcessorSupplier<Integer, String>[] processors;
  
          stream = builder.stream(Serdes.Integer(), Serdes.String(), topicName);
          branches = stream.branch(isEven, isMultipleOfThree, isOdd);
  
          assertEquals(3, branches.length);
  
          processors = (MockProcessorSupplier<Integer, String>[]) Array.newInstance(MockProcessorSupplier.class, branches.length);
          for (int i = 0; i < branches.length; i++) {
              processors[i] = new MockProcessorSupplier<>();
              branches[i].process(processors[i]);
          }
  
          driver = new KStreamTestDriver(builder);
          for (int i = 0; i < expectedKeys.length; i++) {
              driver.process(topicName, expectedKeys[i], "V" + expectedKeys[i]);
          }
  
          assertEquals(3, processors[0].processed.size());
          assertEquals(1, processors[1].processed.size());
          assertEquals(2, processors[2].processed.size());
      }
test_case.class_method_signature: KStreamBranchTest.testKStreamBranch()
test_case.full_signature: @SuppressWarnings("unchecked") @Test public void testKStreamBranch()
test_case.identifier: testKStreamBranch
test_case.invocations: stream Integer String branch assertEquals newInstance process process assertEquals size assertEquals size assertEquals size
test_case.modifiers: @SuppressWarnings("unchecked") @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testKStreamBranch()
focal_class.declarator: predicates
focal_class.modifier: private final
focal_class.original_string: private final Predicate<K, V>[] predicates;
focal_class.type: Predicate<K, V>[]
focal_class.var_name: predicates
focal_class.file: streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamBranch.java
focal_class.identifier: KStreamBranch
focal_class.interfaces: implements ProcessorSupplier<K, V>
focal_class.class_method_signature: KStreamBranch.KStreamBranch(Predicate<K, V> ... predicates)
focal_class.full_signature: @SuppressWarnings("unchecked") public  KStreamBranch(Predicate<K, V> ... predicates)
focal_class.identifier: KStreamBranch
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (Predicate<K, V> ... predicates)
focal_class.signature:  KStreamBranch(Predicate<K, V> ... predicates)
focal_class.class_method_signature: KStreamBranch.get()
focal_class.full_signature: @Override public Processor<K, V> get()
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Processor<K, V>
focal_class.signature: Processor<K, V> get()
focal_method.body: @SuppressWarnings("unchecked")
      public KStreamBranch(Predicate<K, V> ... predicates) {
          this.predicates = predicates;
      }
focal_method.class_method_signature: KStreamBranch.KStreamBranch(Predicate<K, V> ... predicates)
focal_method.full_signature: @SuppressWarnings("unchecked") public  KStreamBranch(Predicate<K, V> ... predicates)
focal_method.identifier: KStreamBranch
focal_method.modifiers: @SuppressWarnings("unchecked") public
focal_method.parameters: (Predicate<K, V> ... predicates)
focal_method.signature:  KStreamBranch(Predicate<K, V> ... predicates)