public static KafkaStreams startSync(final String broker,
                                             final String application,
                                             final String id,
                                             final String processingGuarantee,
                                             final String stateDir) throws InterruptedException {
            final KafkaStreams kafkaStreams =
                new KafkaStreams(getTopology(), getConfig(broker, application, id, processingGuarantee, stateDir));
            final CountDownLatch startUpLatch = new CountDownLatch(1);
            kafkaStreams.setStateListener((newState, oldState) -> {
                if (oldState == KafkaStreams.State.REBALANCING && newState == KafkaStreams.State.RUNNING) {
                    startUpLatch.countDown();
                }
            });
            kafkaStreams.start();
            startUpLatch.await();
            LOG.info("Streams has started.");
            return kafkaStreams;
        }
Generates a keySpace number of unique keys normally distributed,
with the mean at 0 and stdDev 1/3 of the way through the keySpace
any sample more than 3 standard deviations from the mean are assigned to the 0 key.
<p>
This is designed to roughly balance the key properties of two dominant real-world
data distribution: Zipfian and Normal, while also being efficient to generate.
streams/src/test/java/org/apache/kafka/streams/tests/RelationalSmokeTest.java