public static boolean regionMatches(@NotNull CharSequence buffer, int offset, @NotNull CharSequence s) {
    if (offset + s.length() > buffer.length()) return false;
    if (offset < 0) return false;
    for (int i = 0; i < s.length(); i++) {
      if (buffer.charAt(offset + i) != s.charAt(i)) return false;
    }
    return true;
  }
public static boolean regionMatches(@NotNull CharSequence buffer, int offset, @NotNull CharSequence s)