private static String changeFirstCharacterCase(String str, boolean capitalize) {
        if (!hasLength(str)) {
            return str;
        }

        char baseChar = str.charAt(0);
        char updatedChar;
        if (capitalize) {
            updatedChar = Character.toUpperCase(baseChar);
        } else {
            updatedChar = Character.toLowerCase(baseChar);
        }
        if (baseChar == updatedChar) {
            return str;
        }

        char[] chars = str.toCharArray();
        chars[0] = updatedChar;
        return new String(chars);
    }
Capitalize a {@code String}, changing the first letter to
upper case as per {link Character#toUpperCase(char)}.
No other letters are changed.

@param str the {@code String} to capitalize
@return the capitalized {@code String}
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/util/StringUtils.java