protected function createGroup(
        ServiceLocatorInterface $serviceLocator,
        RouteInterface $route,
        array $children,
        bool $abstract = null
    ): RouteInterface {
        /** @var GroupRoute $group */
        $group = $serviceLocator->getService(GroupRoute::class, [
            'route' => $route,
            'abstract' => $abstract,
        ]);

        foreach ($children as $name => $child) {
            $group->addRoute(
                $this->createRoute($serviceLocator, $child),
                $name
            );
        }

        return $group;
    }