private static Iterator<Integer> zipfNormal(final Random random, final int keySpace) {
            return new Iterator<Integer>() {
                @Override
                public boolean hasNext() {
                    return true;
                }

                @Override
                public Integer next() {
                    final double gaussian = Math.abs(random.nextGaussian());
                    final double scaled = gaussian / 3.0; //
                    final double sample = scaled > 1.0 ? 0.0 : scaled;
                    final double keyDouble = sample * keySpace;
                    return (int) keyDouble;
                }
            };
        }
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