public static String credentialToString(ScramCredential credential) {
        return String.format("%s=%s,%s=%s,%s=%s,%s=%d",
               SALT,
               Base64.getEncoder().encodeToString(credential.salt()),
               STORED_KEY,
               Base64.getEncoder().encodeToString(credential.storedKey()),
               SERVER_KEY,
               Base64.getEncoder().encodeToString(credential.serverKey()),
               ITERATIONS,
               credential.iterations());
    }
@Test
    public void generateCredential() {
        ScramCredential credential1 = formatter.generateCredential("password", 4096);
        ScramCredential credential2 = formatter.generateCredential("password", 4096);
        // Random salt should ensure that the credentials persisted are different every time
        assertNotEquals(ScramCredentialUtils.credentialToString(credential1), ScramCredentialUtils.credentialToString(credential2));
    }