public function add(Expectation $e)
    {
        if ($this->mockedMethods !== null && !in_array($e->getMethod(), $this->mockedMethods)) {
            $message = "Attempt to mock unknown method \"{$e->getMethod()}\".";

            if (count($this->mockedMethods) > 0) {
                $message .= " The mocked methods are: " . implode(", ", $this->mockedMethods);
            } else {
                $message .= " There are no methods in the mocked class!";
            }

            throw new UnknownMethodException($message);
        }
        
        $this->expectations[] = $e;
    }