code: @Restricted(NoExternalUse.class)
      public @Nonnull
      Authentication impersonate(@Nonnull UserDetails userDetails) {
          return new UsernamePasswordAuthenticationToken(userDetails.getUsername(), "", userDetails.getAuthorities());
      }
docs: Creates an {@link Authentication} object that represents this user using the given userDetails
  
  @param userDetails Provided by {@link #getUserDetailsForImpersonation()}.
  @see #getUserDetailsForImpersonation()