@Override
    public Object[] toArray() {
        Object[] array = new Object[size()];
        for (int i = 0; i < size(); i++) {
            array[i] = from + i;
        }
        return array;
    }
Constructs a {@code RangeSet} with the specified range.

@param from      The starting value (inclusive) of the range.
@param to        The ending value (exclusive) of the range.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/RangeSet.java