public static boolean areEqualsIgnoreCaseAndTrim(final String s1, final String s2) {
        if (s1 == null && s2 == null) {
            return true;
        } else {
            return s1 != null && s2 != null && s1.trim().equalsIgnoreCase(s2.trim());
        }
    }
Compare two String to see if they are equals ignoring the case and the blank spaces (both null is ok).

@param s1 string
@param s2 string
@return if two String are equals ignoring the case and the blank spaces
pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java