@BeforeEach
    public void setup() throws IOException {
        final StreamsBuilder builder = new StreamsBuilder();
        //Create Actual Stream Processing pipeline
        WordCountDemo.createWordCountStream(builder);
        testDriver = new TopologyTestDriver(builder.build(), WordCountDemo.getStreamsConfig(null));
        inputTopic = testDriver.createInputTopic(WordCountDemo.INPUT_TOPIC, new StringSerializer(), new StringSerializer());
        outputTopic = testDriver.createOutputTopic(WordCountDemo.OUTPUT_TOPIC, new StringDeserializer(), new LongDeserializer());
    }
Unit test of {@link WordCountDemo} stream using TopologyTestDriver.
streams/examples/src/test/java/org/apache/kafka/streams/examples/wordcount/WordCountDemoTest.java