public function addExtension(ExtensionInterface $extension)
    {
        if (array_key_exists($name = $extension->getName(), $this->extensions)) {
            throw new \RuntimeException(sprintf('UserExtension "%s" is already registered.', $name));
        }

        $this->extensions[$name] = $extension;
    }