public static String canonicalize(String identifier, boolean caseSensitive) {

        if (identifier == null)
            return null;

        return caseSensitive ? identifier : identifier.toLowerCase(Locale.ROOT);

    }
Converts the given identifier into a canonical form which ensures simple
verbatim string comparisons are consistent with the case sensitivity
setting. If case-sensitive, identifiers are simply returned without
modification. If case-insensitive, identifiers are converted to
lowercase with respect to the {@link Locale#ROOT} locale.

@param identifier
    The identifier to convert into a canonical form.

@param caseSensitive
    Whether the given identifier is case-sensitive.

@return
    The given identifier, transformed as necessary to ensure that
    verbatim string comparisons are consistent with the case sensitivity
    setting.
guacamole-ext/src/main/java/org/apache/guacamole/properties/CaseSensitivity.java