private static MappedRange @NotNull [] reallocateArray(MappedRange @NotNull [] array, int index) {
    if (index < array.length) return array;
    return ArrayUtil.realloc(array, SegmentArray.calcCapacity(array.length, index), MappedRange[]::new);
  }
private static MappedRange @NotNull [] reallocateArray(MappedRange @NotNull [] array, int index)