protected function getSelectedChoices($choiceViews, array $values)
    {
        $selectedChoices = [];

        foreach ($choiceViews as $index => $choiceView) {
            if ($choiceView instanceof ChoiceGroupView) {
                $selectedChoices = array_merge($selectedChoices, $this->getSelectedChoices($choiceView->choices, $values));
            } elseif ($choiceView instanceof ChoiceView) {
                if (\in_array($choiceView->value, $values)) {
                    $selectedChoices[] = $choiceView;
                }
            }
        }

        return $selectedChoices;
    }