https://sourceforge.net/tracker/index.php?func=detail&aid=1968728&group_id=44253&atid=438935
The previously criticized performance problems when finding an
overlapping region have been avoided: Instead of scanning the entire
ordered set of regions for a document, only the regions between the
first and the last line of the region to be toggled (added/removed)
are considered. This has been efficiently achieved by getting the
headSet of the tailSet of regions.