public function record($arguments, $returnValue, \Exception $thrown = null) {
        $this->history->add(new Call($this->named($arguments), $returnValue, $thrown));

        if (!$this->checkReturnType) {
            return;
        }

        if ($thrown) {
            $this->checkException($thrown);
        } else {
            $this->checkReturnValue($returnValue);
        }
    }