public void assignPassword(final String password) {
        FunctionUtils.doIfNotNull(password, p -> {
            this.password = new char[p.length()];
            System.arraycopy(password.toCharArray(), 0, this.password, 0, password.length());
        }, p -> this.password = ArrayUtils.EMPTY_CHAR_ARRAY);
    }
Sets password and converts it to char array.

@param password the password
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/credential/UsernamePasswordCredential.java