private static AuthenticationData putPassedValueAsSave(AuthenticationData in, boolean storeAuth) {
    if (in instanceof PasswordAuthenticationData) {
      return new PasswordAuthenticationData(((PasswordAuthenticationData)in).getCredentials(), storeAuth);
    }
    else if (in instanceof CertificateAuthenticationData) {
      return new CertificateAuthenticationData(((CertificateAuthenticationData)in).getCertificate(), storeAuth);
    }
    return in;
  }
private static AuthenticationData putPassedValueAsSave(AuthenticationData in, boolean storeAuth)