docs: private Map<String, SortedSet<PortletCategoryBean>> getRegistry43(
              WebRequest request,
              IPerson user,
              PortletCategory rootCategory,
              boolean includeUncategorized,
              Set<IPortletDefinition> favorites) {
  
          /*
           * This collection of all the portlets in the portal is for the sake of
           * tracking which ones are uncategorized.  They will be added to the
           * output if includeUncategorized=true.
           */
          Set<IPortletDefinition> portletsNotYetCategorized =
                  includeUncategorized
                          ? new HashSet<>(portletDefinitionRegistry.getAllPortletDefinitions())
                          : new HashSet<>(); // Not necessary to fetch them if we're not
          // tracking them
  
          // construct a new channel registry
          Map<String, SortedSet<PortletCategoryBean>> rslt = new TreeMap<>();
          SortedSet<PortletCategoryBean> categories = new TreeSet<>();
  
          // add the root category and all its children to the registry
          final Locale locale = getUserLocale(user);
          categories.add(
                  preparePortletCategoryBean(
                          request, rootCategory, portletsNotYetCategorized, user, locale, favorites));
  
          if (includeUncategorized) {
              /*
               * uPortal historically has provided for a convention that portlets not in any category
               * may potentially be viewed by users but may not be subscribed to.
               *
               * As of uPortal 4.2, the logic below now takes any portlets the user has BROWSE access to
               * that have not already been identified as belonging to a category and adds them to a category
               * called Uncategorized.
               */
  
              EntityIdentifier ei = user.getEntityIdentifier();
              IAuthorizationPrincipal ap =
                      AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType());
  
              Set<PortletDefinitionBean> marketplacePortlets = new HashSet<>();
              for (IPortletDefinition portlet : portletsNotYetCategorized) {
                  if (authorizationService.canPrincipalBrowse(ap, portlet)) {
                      PortletDefinitionBean pdb =
                              preparePortletDefinitionBean(
                                      request, portlet, locale, favorites.contains(portlet));
                      marketplacePortlets.add(pdb);
                  }
              }
  
              // construct a new channel category bean for this category
              final String uncName = messageSource.getMessage(UNCATEGORIZED, new Object[] {}, locale);
              final String uncDescription =
                      messageSource.getMessage(UNCATEGORIZED_DESC, new Object[] {}, locale);
              PortletCategory pc =
                      new PortletCategory(
                              uncName); // Use of this String for Id matches earlier version of API
              pc.setName(uncName);
              pc.setDescription(uncDescription);
              PortletCategoryBean unc =
                      PortletCategoryBean.fromPortletCategory(pc, null, marketplacePortlets);
  
              // Add even if no portlets in category
              categories.add(unc);
          }
  
          rslt.put(CATEGORIES_MAP_KEY, categories);
          return rslt;
      }