NumberRange[] newRanges = new NumberRange[ranges.length - (j - i)];
System.arraycopy(ranges, 0, newRanges, 0, i);
if (j < (ranges.length - 1)) {
System.arraycopy(ranges, j + 1, newRanges, j, newRanges.length - j);
}
newRanges[i] = new NumberRange(ranges[i].start(), ranges[j].end(), min - 1, max + 1);
return newRanges;
}