code: private void addChildrenForGroupsNode(I_CmsOuTreeType type, String ouItem) {
  
          try {
              // Cut of type-specific prefix from ouItem with substring()
              List<CmsGroup> groups = m_app.readGroupsForOu(m_cms, ouItem.substring(1), type, false);
              for (CmsGroup group : groups) {
                  Pair<String, CmsUUID> key = Pair.of(type.getId(), group.getId());
                  Item groupItem = m_treeContainer.addItem(key);
                  if (groupItem == null) {
                      groupItem = getItem(key);
                  }
                  groupItem.getItemProperty(PROP_SID).setValue(group.getId());
                  groupItem.getItemProperty(PROP_NAME).setValue(getIconCaptionHTML(group, CmsOuTreeType.GROUP));
                  groupItem.getItemProperty(PROP_TYPE).setValue(type);
                  setChildrenAllowed(key, false);
                  m_treeContainer.setParent(key, ouItem);
              }
          } catch (CmsException e) {
              LOG.error("Can not read group", e);
          }
      }
docs: Add groups for given group parent item.
  
  @param type the tree type
  @param ouItem group parent item