private function appendChildren(ItemInterface $menu)
    {
        foreach ($this->pool->getGroups() as $group) {

            $groupOptions = [
                'labelAttributes' => ['icon' => $group->getIcon()],
                'childrenAttributes' => ['class' => 'submenu']
            ];

            if ($group->hasEntries()) {
                $groupOptions['labelAttributes']['class'] = 'dropdown-toggle';

                $groupEntries = [];
                foreach ($group->getEntries() as $entry) {
                    if (!$this->entrySecurityCheck($entry)) {
                        continue;
                    }

                    $groupEntry = $this->factory->createItem($entry->getName(), [
                        'route' => $entry->getRoute()
                    ]);
                    $groupEntry
                        ->setLabel($entry->getLabel())
                        ->setExtra('translation_domain', $entry->getDomain())
                    ;

                    $groupEntries[] = $groupEntry;
                }

                if (0 < count($groupEntries)) {
                    $menuGroup = $menu
                        ->addChild($group->getName(), $groupOptions)
                        ->setLabel($group->getLabel())
                        ->setExtra('translation_domain', $group->getDomain())
                    ;
                    foreach ($groupEntries as $groupEntry) {
                        $menuGroup->addChild($groupEntry);
                    }
                }
            } else {
                $groupOptions['route'] = $group->getRoute();
                $menu
                    ->addChild($group->getName(), $groupOptions)
                    ->setLabel($group->getLabel())
                    ->setExtra('translation_domain', $group->getDomain())
                ;
            }
        }
    }