private static boolean rangesEqual(@NotNull CharSequence text, int start1, int end1, int start2, int end2) {
    if (end1 - start1 != end2 - start2) return false;
    for (int i = start1; i < end1; i++) {
      if (text.charAt(i) != text.charAt(i - start1 + start2)) return false;
    }
    return true;
  }
private static boolean rangesEqual(@NotNull CharSequence text, int start1, int end1, int start2, int end2)