code: public static void changeUser(IUser user) {
          try {
              getUserContext().requestContextChange(user);
          } catch (Exception e) {
              log.error("Error during user context change.", e);
          }
      }
docs: Request a user context change.
  
  @param user New user