public function on(RequestMatcher $requestMatcher, $result)
    {
        $callable = null;

        switch (true) {
            case is_callable($result):
                $callable = $result;

                break;
            case $result instanceof ResponseInterface:
                $callable = function () use ($result) {
                    return $result;
                };

                break;
            case $result instanceof \Exception:
                $callable = function () use ($result) {
                    throw $result;
                };

                break;
            default:
                throw new \InvalidArgumentException('Result must be either a response, an exception, or a callable');
        }
        $this->conditionalResults[] = [
            'matcher' => $requestMatcher,
            'callable' => $callable,
        ];
    }