int (@NotNull CharSequence chars) { if (chars instanceof String || chars instanceof CharSequenceWithStringHash) { // we know for sure these classes have conformant (and maybe faster) hashCode() return chars.hashCode(); } return stringHashCode(chars, 0, chars.length()); }