private static boolean areConflicting(TextRange range1, TextRange range2) {
    if (range1.equals(range2)) return true;
    if (range1.contains(range2) || range2.contains(range1)) return false;

    return range1.intersectsStrict(range2);
  }
private static boolean areConflicting(TextRange range1, TextRange range2)