robe-auth/src/main/java/io/robe/auth/AbstractAuthResource.java
public String generateStrongPassword(T user, String oldPassword) {
        String newPassword;
        do {
            newPassword = generateStrongPassword();
            // Continue until new password does not contain user info or same with old password
        }
        while (newPassword.contains(user.getUsername()) || oldPassword.equals(Hashing.sha256().hashString(newPassword, Charset.forName("UTF-8")).toString()));
        return newPassword;
    }
public String generateStrongPassword(T user, String oldPassword) {
        String newPassword;
        do {
            newPassword = generateStrongPassword();
            // Continue until new password does not contain user info or same with old password
        }
        while (newPassword.contains(user.getUsername()) || oldPassword.equals(Hashing.sha256().hashString(newPassword, Charset.forName("UTF-8")).toString()));
        return newPassword;
    }
public String generateStrongPassword ( T user , String oldPassword ) { String newPassword ; do { newPassword = generateStrongPassword ( ) ; // Continue until new password does not contain user info or same with old password } while ( newPassword . contains ( user . getUsername ( ) ) || oldPassword . equals ( Hashing . sha256 ( ) . hashString ( newPassword , Charset . forName ( "UTF-8" ) ) . toString ( ) ) ) ; return newPassword ; }
Generate strong password that takes into account the user's information and old password. Implementations
should verify that the new password does not include information such as the username, fragments of the
old password, and other information that could be used to weaken the strength of the password.

@param user        the user whose information to use when generating password
@param oldPassword the old password to use when verifying strength of new password.  The new password may be checked for fragments of oldPassword.
@return a password with strong password strength
Generate strong password that takes into account the user s information and old password . Implementations should verify that the new password does not include information such as the username fragments of the old password and other information that could be used to weaken the strength of the password .