@Override
    public Object[] toArray() {
        Object[] array = new Object[size()];
        for (int i = 0; i < size(); i++) {
            array[i] = from + i;
        }
        return array;
    }
@Test
    void testToArray() {
        RangeSet rangeSet = new RangeSet(5, 10);
        Object[] expectedArray = {5, 6, 7, 8, 9};
        assertArrayEquals(expectedArray, rangeSet.toArray());
    }