public static function createEmbeddedShell(SessionInterface $session)
    {
        $container = new Container(self::MODE_EMBEDDED_SHELL);
        $container->get('phpcr.session_manager')->setSession(new PhpcrSession($session));
        $application = $container->get('application');

        return new Shell($application);
    }