public function getReachableGroups(array $groups)
    {
        $reachableGroups = $groups;
        foreach ($groups as $group) {
            if (!isset($this->map[$group])) {
                continue;
            }

            $reachableGroups = array_merge($reachableGroups, $this->map[$group]);
        }

        return array_unique(
            array_merge($reachableGroups, $this->groupAlwaysPresent)
        );
    }