@Test
    public void testCountListOfWords() {
        final List<String> inputValues = Arrays.asList(
                "Apache   Kafka Streams   Example",
                "Using  \t\t Kafka   Streams\tTest Utils",
                "Reading and Writing Kafka Topic"
        );
        final Map<String, Long> expectedWordCounts = new HashMap<>();
        expectedWordCounts.put("apache", 1L);
        expectedWordCounts.put("kafka", 3L);
        expectedWordCounts.put("streams", 2L);
        expectedWordCounts.put("example", 1L);
        expectedWordCounts.put("using", 1L);
        expectedWordCounts.put("test", 1L);
        expectedWordCounts.put("utils", 1L);
        expectedWordCounts.put("reading", 1L);
        expectedWordCounts.put("and", 1L);
        expectedWordCounts.put("writing", 1L);
        expectedWordCounts.put("topic", 1L);

        inputTopic.pipeValueList(inputValues);
        final Map<String, Long> actualWordCounts = outputTopic.readKeyValuesToMap();
        assertThat(actualWordCounts, equalTo(expectedWordCounts));
    }
Test Word count of sentence list.
streams/examples/src/test/java/org/apache/kafka/streams/examples/wordcount/WordCountDemoTest.java