private function generateGroups(array $groups, $parentId, Definition $parent, ContainerBuilder $container)
    {
        foreach ($groups as $groupName => $group) {
            $groupId = $parentId.'.'.$groupName;

            $groupDefinition = $this->createComponentDefinition($groupName, $group['class'], $group['options']);
            $groupDefinition->addMethodCall('setService', array(new Reference($parentId)));

            $this->generateActions($group['actions'], $groupId, $groupDefinition, $container);

            $container->setDefinition($groupId, $groupDefinition);

            $parent->addMethodCall('addGroup', array(new Reference($groupId)));
        }
    }