CredentialsConfig extends SimpleComponent<CredentialsConfig> implements PasswordsConfig<CredentialsConfig> { @Override public CredentialsConfig withDecryptedPasswords(final TextEncryptor encryptor) { return toBuilder() .password(encryptor.decrypt((password != null && password.isEmpty()) ? null : password)) .build(); }  @Override CredentialsConfig withoutPasswords(); @Override CredentialsConfig withEncryptedPasswords(final TextEncryptor encryptor); @Override CredentialsConfig withDecryptedPasswords(final TextEncryptor encryptor); @Override CredentialsConfig merge(final CredentialsConfig config);  }
@Test public void testWithDecryptedPasswords() { Assert.assertEquals(new CredentialsConfig("user", "pass"), new CredentialsConfig("user", "encrypted:pass").withDecryptedPasswords(encryptor)); }