protected function _containerSet(&$container, $key, $value)
    {
        $key = $this->_normalizeKey($key);

        try {
            if (is_array($container)) {
                $container[$key] = $value;

                return;
            }

            if ($container instanceof ArrayAccess) {
                $container->offsetSet($key, $value);

                return;
            }

            if ($container instanceof stdClass) {
                $container->{$key} = $value;

                return;
            }
        } catch (RootException $e) {
            throw $this->_createContainerException($this->__('Could not write to container key "%1$s"', [$key]), null, $e);
        }

        throw $this->_createInvalidArgumentException($this->__('Not a valid container'), null, null, $container);
    }