static Bytes lowerRange(final Bytes key, final byte[] minSuffix) {
        final byte[] bytes = key.get();
        final ByteBuffer rangeStart = ByteBuffer.allocate(bytes.length + minSuffix.length);
        // any key in the range would start at least with the given prefix to be
        // in the range, and have at least SUFFIX_SIZE number of trailing zero bytes.

        // unless there is a maximum key length, you can keep appending more zero bytes
        // to keyFrom to create a key that will match the range, yet that would precede
        // KeySchema.toBinaryKey(keyFrom, from, 0) in byte order
        return Bytes.wrap(
            rangeStart
                .put(bytes)
                .put(minSuffix)
                .array()
        );
    }
Returns the upper byte range for a key with a given fixed size maximum suffix

Assumes the minimum key length is one byte
streams/src/main/java/org/apache/kafka/streams/state/internals/OrderedBytes.java