public function ask(IQuestion $question, IResponse $response)
    {
        $response->write("<question>{$question->getText()}</question>");

        if ($question instanceof MultipleChoice) {
            /** @var MultipleChoice $question */
            $response->writeln('');
            $choicesAreAssociative = $question->choicesAreAssociative();
            $choiceTexts = [];

            foreach ($question->getChoices() as $key => $choice) {
                if (!$choicesAreAssociative) {
                    // Make the choice 1-indexed
                    ++$key;
                }

                $choiceTexts[] = [$key . ')', $choice];
            }

            $response->writeln($this->paddingFormatter->format($choiceTexts, function ($row) {
                return "  {$row[0]} {$row[1]}";
            }));
            $response->write($question->getAnswerLineString());
        }

        $answer = fgets($this->inputStream, 4096);

        if ($answer === false) {
            throw new RuntimeException('Failed to get answer');
        }

        $answer = trim($answer);

        if ($answer === '') {
            $answer = $question->getDefaultAnswer();
        }

        return $question->formatAnswer($answer);
    }