private function filterParent($parent, MenuItemCollection $items)
    {
        $filteredItems = new MenuItemCollection();

        foreach ($items->getItems() as $name => $item) {
            if ($parent === $item->getParent()) {
                $subItems = $this->filterParent($name, $items);
                if (count($subItems)) {
                    $item->setItems($subItems);
                }
                $filteredItems->set($name, $item);
                $items->remove($name);
            }
        }

        return $filteredItems;
    }