public ModeledAuthenticatedUser(AuthenticatedUser authenticatedUser,AuthenticationProvider modelAuthenticationProvider,ModeledUser user){
  super(authenticatedUser.getAuthenticationProvider(),authenticatedUser.getCredentials());
  this.modelAuthenticationProvider=modelAuthenticationProvider;
  this.user=user;
}

public ModeledAuthenticatedUser ( AuthenticatedUser authenticatedUser , AuthenticationProvider modelAuthenticationProvider , ModeledUser user ) { super ( authenticatedUser . getAuthenticationProvider ( ) , authenticatedUser . getCredentials ( ) ) ; this . modelAuthenticationProvider = modelAuthenticationProvider ; this . user = user ; }
creates a copy of the given authenticateduser which is associated with the data stored in the provided modeleduser . the authenticateduser need not have come from the same authenticationprovider which produced the given modeleduser .
