public static void enforceParameterContentCharacterRestrictions(
        final Set<String> parametersToCheck, final Set<Character> charactersToForbid, final Map parameterMap) {

        if (charactersToForbid.isEmpty()) {
            return;
        }

        for (val parameterToCheck : parametersToCheck) {
            val parameterValues = (String[]) parameterMap.get(parameterToCheck);
            if (null != parameterValues) {
                for (val parameterValue : parameterValues) {
                    for (val forbiddenCharacter : charactersToForbid) {
                        if (parameterValue.contains(forbiddenCharacter.toString())) {
                            throwException(new IllegalArgumentException("Disallowed character [" + forbiddenCharacter
                                                                      + "] found in value [" + parameterValue + "] of parameter named ["
                                                                      + parameterToCheck + ']'));
                        }
                    }
                }
            }
        }
    }
For each parameter to check, for each value of that parameter, check that the value does not contain
forbidden characters.
<p>
This method is an implementation detail and is not exposed API.
This method is only non-private to allow JUnit testing.

@param parametersToCheck  Set of String request parameter names to look for
@param charactersToForbid Set of Character characters to forbid
@param parameterMap       String to String[] Map, in practice as read from ServletRequest
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/filters/RequestParameterPolicyEnforcementFilter.java