private function selectedQueriesInGroupWithWildcard($subjects, $wildcard)
    {
        $queries = [];

        foreach ($subjects as $subject) {
            if ($subject['selected'] && $subject['queries']) {
                $this->addSearchTermsToList($subject['queries'], $queries, $wildcard);
            } elseif ($subject['subjects']) {
                $subsubjects = $this->selectedQueriesInGroupWithWildcard($subject['subjects'], $wildcard);
                $queries = array_merge($queries, $subsubjects);
            }
        }
        return $queries;
    }