public static String toSnakeCase(String word) {
        if (StringUtils.isEmpty(word)) {
            return word;
        }

        String firstPattern = "([A-Z]+)([A-Z][a-z])";
        String secondPattern = "([a-z\\d])([A-Z])";
        String replacementPattern = "$1_$2";
        // Replace capital letter with _ plus lowercase letter.
        word = word.replaceAll(firstPattern, replacementPattern);
        word = word.replaceAll(secondPattern, replacementPattern);
        word = word.replaceAll("(\\s|-)", "_");
        // Begin modification
        word = word.toLowerCase(Locale.US);
        // End modification
        return word;
    }
Convert a given word to snake_case with all lowercase letters.

<p>This method was based on Elephant Bird's underscore method.
"-", " ", "\n", "\t", "\r" are replaced with "_".

<p>Note: this method does not sanitize the string for use as a snake_case
variable in any specific programming language.

@param word The word to convert.
@return The underscored version of the word
@see <a href="https://github.com/twitter/elephant-bird/blob/master/core/src/main/java/com/twitter/elephantbird/util/Strings.java">Elephant bird</a>
smithy-utils/src/main/java/software/amazon/smithy/utils/CaseUtils.java