@Override
        public Processor<String, String, String, String> get() {
            return new Processor<String, String, String, String>() {
                private KeyValueStore<String, Integer> kvStore;

                @Override
                public void init(final ProcessorContext<String, String> context) {
                    context.schedule(Duration.ofSeconds(1), PunctuationType.STREAM_TIME, timestamp -> {
                        try (final KeyValueIterator<String, Integer> iter = kvStore.all()) {
                            System.out.println("----------- " + timestamp + " ----------- ");

                            while (iter.hasNext()) {
                                final KeyValue<String, Integer> entry = iter.next();

                                System.out.println("[" + entry.key + ", " + entry.value + "]");
                                context.forward(new Record<>(entry.key, entry.value.toString(), timestamp));
                            }
                        }
                    });
                    this.kvStore = context.getStateStore("Counts");
                }

                @Override
                public void process(final Record<String, String> record) {
                    final String[] words = record.value().toLowerCase(Locale.getDefault()).split("\\W+");

                    for (final String word : words) {
                        final Integer oldValue = this.kvStore.get(word);

                        if (oldValue == null) {
                            this.kvStore.put(word, 1);
                        } else {
                            this.kvStore.put(word, oldValue + 1);
                        }
                    }
                }
            };
        }
Demonstrates, using a {@link Processor} implementing the low-level Processor APIs (replaces Transformer),
how to implement the WordCount program that computes a simple word occurrence histogram from an input text.
<p>
<strong>Note: This is simplified code that only works correctly for single partition input topics.
Check out {@link WordCountDemo} for a generic example.</strong>
<p>
In this example, the input stream reads from a topic named "streams-plaintext-input", where the values of messages
represent lines of text; and the histogram output is written to topic "streams-wordcount-processor-output" where each record
is an updated count of a single word.
<p>
This example differs from {@link WordCountProcessorDemo} in that it uses a {@link ProcessorSupplier} to attach the Processor with the
count logic to the Stream, and the topology is wired up through a {@link StreamsBuilder},
which more closely resembles the high-level DSL (compared to the Topology builder approach, with Source, Processor, Sink).
<p>
Before running this example you must create the input topic and the output topic (e.g. via
{@code bin/kafka-topics.sh --create ...}), and write some data to the input topic (e.g. via
{@code bin/kafka-console-producer.sh}). Otherwise you won't see any data arriving in the output topic.
streams/examples/src/main/java/org/apache/kafka/streams/examples/wordcount/WordCountTransformerDemo.java