if (previousRangeGroup.nonEmptyRangeMapping == null) {
previousRangeEnd = previousRangeStart;
} else {
previousRangeEnd = previousRangeGroup.nonEmptyRangeMapping.sourceRange.end;
}
if (previousRangeEnd.compareTo(range.start) > 0) {
throw new CannotAddException("Ranges overlaps: " + range + " with " +
new Range(previousRangeStart, previousRangeEnd));
}
}
}