public static Optional<String> doGetSafeValue(@Nullable CredentialAttributes credentialAttributes) {
    return Optional.ofNullable(credentialAttributes)
      .map(attributes -> PasswordSafe.getInstance().get(attributes))
      .map(Credentials::getPasswordAsString);
  }
public static Optional<String> doGetSafeValue(@Nullable CredentialAttributes credentialAttributes)