StorageRecord[] (int count, int maxSize) { final ThreadLocalRandom rnd = ThreadLocalRandom.current(); //exponential distribution with avg=30, cut off [0, maxSize]: IntSupplier payloadSizeGenerator = () -> (int)Math.max(Math.min(rnd.nextExponential() * 30, maxSize), 0); return generateRecords(count, payloadSizeGenerator); }