test_class.declarator: topicName = "topic"
test_class.modifier: final private
test_class.original_string: final private String topicName = "topic";
test_class.type: String
test_class.var_name: topicName
test_class.declarator: intSerde = Serdes.Integer()
test_class.modifier: final private
test_class.original_string: final private Serde<Integer> intSerde = Serdes.Integer();
test_class.type: Serde<Integer>
test_class.var_name: intSerde
test_class.declarator: stringSerde = Serdes.String()
test_class.modifier: final private
test_class.original_string: final private Serde<String> stringSerde = Serdes.String();
test_class.type: Serde<String>
test_class.var_name: stringSerde
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/KStreamForeachTest.java
test_class.identifier: KStreamForeachTest
test_case.body: @Test
      public void testForeach() {
          // Given
          List<KeyValue<Integer, String>> inputRecords = Arrays.asList(
              new KeyValue<>(0, "zero"),
              new KeyValue<>(1, "one"),
              new KeyValue<>(2, "two"),
              new KeyValue<>(3, "three")
          );
  
          List<KeyValue<Integer, String>> expectedRecords = Arrays.asList(
              new KeyValue<>(0, "ZERO"),
              new KeyValue<>(2, "ONE"),
              new KeyValue<>(4, "TWO"),
              new KeyValue<>(6, "THREE")
          );
  
          final List<KeyValue<Integer, String>> actualRecords = new ArrayList<>();
          ForeachAction<Integer, String> action =
              new ForeachAction<Integer, String>() {
                  @Override
                  public void apply(Integer key, String value) {
                      actualRecords.add(new KeyValue<>(key * 2, value.toUpperCase(Locale.ROOT)));
                  }
              };
  
          // When
          KStreamBuilder builder = new KStreamBuilder();
          KStream<Integer, String> stream = builder.stream(intSerde, stringSerde, topicName);
          stream.foreach(action);
  
          // Then
          driver = new KStreamTestDriver(builder);
          for (KeyValue<Integer, String> record: inputRecords) {
              driver.process(topicName, record.key, record.value);
          }
  
          assertEquals(expectedRecords.size(), actualRecords.size());
          for (int i = 0; i < expectedRecords.size(); i++) {
              KeyValue<Integer, String> expectedRecord = expectedRecords.get(i);
              KeyValue<Integer, String> actualRecord = actualRecords.get(i);
              assertEquals(expectedRecord, actualRecord);
          }
      }
test_case.class_method_signature: KStreamForeachTest.testForeach()
test_case.full_signature: @Test public void testForeach()
test_case.identifier: testForeach
test_case.invocations: asList asList add toUpperCase stream foreach process assertEquals size size size get get assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testForeach()
focal_class.declarator: action
focal_class.modifier: private final
focal_class.original_string: private final ForeachAction<K, V> action;
focal_class.type: ForeachAction<K, V>
focal_class.var_name: action
focal_class.file: streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamForeach.java
focal_class.identifier: KStreamForeach
focal_class.interfaces: implements ProcessorSupplier<K, V>
focal_class.class_method_signature: KStreamForeach.KStreamForeach(ForeachAction<K, V> action)
focal_class.full_signature: public  KStreamForeach(ForeachAction<K, V> action)
focal_class.identifier: KStreamForeach
focal_class.modifiers: public
focal_class.parameters: (ForeachAction<K, V> action)
focal_class.signature:  KStreamForeach(ForeachAction<K, V> action)
focal_class.class_method_signature: KStreamForeach.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: @Override
      public Processor<K, V> get() {
          return new KStreamForeachProcessor();
      }
focal_method.class_method_signature: KStreamForeach.get()
focal_method.full_signature: @Override public Processor<K, V> get()
focal_method.identifier: get
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Processor<K, V>
focal_method.signature: Processor<K, V> get()