code: public static IndexedContainer getAvailableGroupsContainerWithout(
          CmsObject cms,
          String ouFqn,
          String propCaption,
          String propIcon,
          String propOu,
          List<CmsGroup> blackList,
          java.util.function.Function<CmsGroup, CmsCssIcon> iconProvider) {
  
          if (blackList == null) {
              blackList = new ArrayList<CmsGroup>();
          }
          IndexedContainer res = new IndexedContainer();
          res.addContainerProperty(propCaption, String.class, "");
          res.addContainerProperty(propOu, String.class, "");
          if (propIcon != null) {
              res.addContainerProperty(propIcon, CmsCssIcon.class, null);
          }
          try {
              for (CmsGroup group : OpenCms.getRoleManager().getManageableGroups(cms, ouFqn, true)) {
                  if (!blackList.contains(group)) {
                      Item item = res.addItem(group);
                      if (item == null) {
                          continue;
                      }
                      if (iconProvider != null) {
                          item.getItemProperty(propIcon).setValue(iconProvider.apply(group));
                      }
                      item.getItemProperty(propCaption).setValue(group.getSimpleName());
                      item.getItemProperty(propOu).setValue(group.getOuFqn());
                  }
              }
  
          } catch (CmsException e) {
              LOG.error("Unable to read groups", e);
          }
          return res;
      }
docs: Get all groups with blacklist.<p>
  
  @param cms CmsObject
  @param ouFqn ou name
  @param propCaption property
  @param propIcon property for icon
  @param propOu organizational unit
  @param blackList blacklist
  @param iconProvider the icon provider
  @return indexed container