code: public static String formatCurrentTenant() {
          final UserDetails userDetails = getCurrentUser();
          if (!(userDetails instanceof UserPrincipal)) {
              return null;
          }
  
          final UserPrincipal userPrincipal = (UserPrincipal) userDetails;
          return trimAndFormatDetail(userPrincipal.getTenant(), 8);
      }
docs: Format the current tenant. The information is loaded by the current
  session information.
  
  @return the formatted user name (max 8 characters) can be <null>