public int loadStatsRangeEnd() {
        assert partitionLoadStats != null;
        assert partitionLoadStats.length > 0;
        return partitionLoadStats.cumulativeFrequencyTable[partitionLoadStats.length - 1];
    }
Test-only function.  When partition load stats are defined, return the end of range for the
random number.
clients/src/main/java/org/apache/kafka/clients/producer/internals/BuiltInPartitioner.java