public IndexRange mergedWith ( final IndexRange other ) { Objects . requireNonNull ( other , "other" ) ; return new IndexRange ( Math . min ( start , other . start ) , Math . max ( end , other . end ) ) ; }
Created a new IndexRange that spans all characters between the smallest and the highest index of the two ranges .