public function addMethod(string $name, callable $callback = null): self
    {
        if ($this->isFinalized) {
            throw new FinalizedMockException();
        }
        if (!$callback) {
            $callback = $this->emptyCallback;
        }

        $this->customMethods[$name] = [
            $callback,
            $this->invocableInspector->callbackReflector($callback),
        ];

        return $this;
    }