addInterval
Adds an interval to the collection, merging intervals that contain the same data and splitting intervals of different data as needed in order to maintain a non-overlapping collection. The data in the new interval takes precedence over any existing intervals in the collection.
Parameters
interval
The interval to add.
dataComparer
A function which compares the data of the two intervals. If omitted, reference equality is used.