public function extend($binding, \Closure $closure)
    {
        $rawObject = $this->getRaw($binding);

        if (is_null($rawObject)) {
            throw new \InvalidArgumentException(sprintf('Cannot extend %s because it has not yet been bound.', $binding));
        }

        $this->bind($binding, function ($container) use ($closure, $rawObject) {
            return $closure($container, $rawObject($container));
        });
    }