public UserAccountDetails(UserAccount userAccount) { this.username = userAccount.getUsername(); this.password = userAccount.getPassword().toString(); this.isEnabled = userAccount.isEnabled(); this.authorities = userAccount.getRoles() // .map(role -> new SimpleGrantedAuthority(role.getName())) // .toList(); }