private static boolean endsWith(CharSequence str, CharSequence suffix, boolean ignoreCase) {
        if (str == null || suffix == null) {
            return str == null && suffix == null;
        }
        if (suffix.length() > str.length()) {
            return false;
        }
        int strOffset = str.length() - suffix.length();
        return CharSequenceUtils.regionMatches(str, ignoreCase, strOffset, suffix, 0, suffix.length());
    }
<p>Check if a CharSequence ends with a specified suffix (optionally case insensitive).</p>

@see String#endsWith(String)
@param str  the CharSequence to check, may be null
@param suffix the suffix to find, may be null
@param ignoreCase indicates whether the compare should ignore case
 (case insensitive) or not.
@return {@code true} if the CharSequence starts with the prefix or
 both {@code null}
android/android_framework/base/src/main/java/lang3/StringUtils.java