word) -> word) // Count the occurrences of each word (record key). // // This will change the stream type from `KGroupedStream<String, String>` to // `KTable<String, Long>` (word -> count). .count() // Convert the `KTable<String, Long>` into a `KStream<String, Long>`. .toStream(); 21