protected static function createContainer()
    {
        $app = JFactory::getApplication();

        if (is_null($app->get('container', null))) {
            $app->set('container', new Container());
        }

        $container = $app->get('container');

        if (!method_exists($container, 'set')) {
            $container = new Container($container);
        }

        return $container;
    }