public static boolean regionMatches(@NotNull CharSequence s1, int start1, int end1, @NotNull CharSequence s2, int start2, int end2) {
    if (end1 - start1 != end2 - start2) return false;
    assertRegionIndicesInRange(s1.length(), start1, end1, s2.length(), start2, end2);

    for (int i = start1, j = start2; i < end1; i++, j++) {
      if (s1.charAt(i) != s2.charAt(j)) return false;
    }
    return true;
  }
public static boolean regionMatches(@NotNull CharSequence s1, int start1, int end1, @NotNull CharSequence s2, int start2, int end2)