code: public static List<String> getTenantNames(TenantService tenantService) throws ProfileException {
          List<Tenant> tenants = tenantService.getAllTenants();
          List<String> tenantNames = new ArrayList<>(tenants.size());
  
          if (CollectionUtils.isNotEmpty(tenants)) {
              for (Tenant tenant : tenants) {
                  tenantNames.add(tenant.getName());
              }
          }
  
          return tenantNames;
      }
docs: Returns a list with the names of all tenants.
  
  @param tenantService the service that retrieves the {@link org.craftercms.profile.api.Tenant}s.
  
  @return the list of tenant names