private void createSubgroups(GroupHierarchyConfig config, String groupId) {
        config.getSubitems().forEach(cfg -> {
            if (cfg instanceof GroupHierarchyConfig) {
                GroupMetadata curGroup = findGroup((GroupHierarchyConfig) cfg, groupId);
                String subGroupId;
                if (curGroup != null) {
                    subGroupId = curGroup.getId();
                } else {
                    subGroupId = create(converter.createGroupConfig((GroupHierarchyConfig) cfg, groupId))
                        .getResult()
                        .as(GroupByIdRef.class)
                        .getId();
                }
                createSubgroups((GroupHierarchyConfig) cfg, subGroupId);
            } else if (cfg instanceof CreateServerConfig) {
                ((CreateServerConfig) cfg).group(Group.refById(groupId));
            } else {
                ((CompositeServerConfig) cfg).getServer().group(Group.refById(groupId));
            }
        });
    }
private void createSubgroups ( GroupHierarchyConfig config , String groupId ) { config . getSubitems ( ) . forEach ( cfg -> { if ( cfg instanceof GroupHierarchyConfig ) { GroupMetadata curGroup = findGroup ( ( GroupHierarchyConfig ) cfg , groupId ) ; String subGroupId ; if ( curGroup != null ) { subGroupId = curGroup . getId ( ) ; } else { subGroupId = create ( converter . createGroupConfig ( ( GroupHierarchyConfig ) cfg , groupId ) ) . getResult ( ) . as ( GroupByIdRef . class ) . getId ( ) ; } createSubgroups ( ( GroupHierarchyConfig ) cfg , subGroupId ) ; } else if ( cfg instanceof CreateServerConfig ) { ( ( CreateServerConfig ) cfg ) . group ( Group . refById ( groupId ) ) ; } else { ( ( CompositeServerConfig ) cfg ) . getServer ( ) . group ( Group . refById ( groupId ) ) ; } } ) ; }
Create sub groups in group with {@code groupId}
@param config  group hierarchy config
@param groupId group id