@Override
  public boolean textMatches(@NotNull CharSequence buf, int start, int end) {
    CharSequence text = getChars();
    int len = text.length();

    if (end - start != len) return false;
    if (buf == text) return true;

    if (len > TEXT_MATCHES_THRESHOLD && text instanceof String && buf instanceof String) {
      return ((String)text).regionMatches(0,(String)buf,start,len);
    }

    for (int i = 0; i < len; i++) {
      if (text.charAt(i) != buf.charAt(start + i)) return false;
    }

    return true;
  }
@Override
  public boolean textMatches(@NotNull CharSequence buf, int start, int end)