@Benchmark
    @CompilerControl(CompilerControl.Mode.DONT_INLINE)
    public void testSizeOfUnsignedVarintSimple(IterationStateForInt state, Blackhole bk) {
        for (int randomValue : state.getRandomValues()) {
            int value = randomValue;
            int bytes = 1;
            while ((value & 0xffffff80) != 0L) {
                bytes += 1;
                value >>>= 7;
            }
            bk.consume(bytes);
        }
    }
Generates a random int32 number which occupies exactly bytesSet in the variable length encoding for int32

@see {@link #generateRandomLongWithExactBytesSet(int)} for implementation details.
jmh-benchmarks/src/main/java/org/apache/kafka/jmh/util/ByteUtilsBenchmark.java