code: public static void setCurrentUser(UserGroupInformation ugi) {
      Subject user = SecurityUtil.getSubject(ugi);
      currentUser.set(user);
    }
docs: Set the {@link UserGroupInformation} for the current thread
  WARNING - This method should be used only in test cases and other exceptional
  cases!
  @param ugi {@link UserGroupInformation} for the current thread