@SuppressWarnings({"unchecked"})
    protected Context createInitialContext() throws NamingException {
        Properties env = getEnvironment();
        Hashtable icEnv = null;
        if (env != null) {
            icEnv = new Hashtable(env.size());
            for (Enumeration en = env.propertyNames(); en.hasMoreElements(); ) {
                String key = (String) en.nextElement();
                icEnv.put(key, env.getProperty(key));
            }
        }
        return new InitialContext(icEnv);
    }
Create a new JNDI initial context. Invoked by {@link #execute}.
<p>The default implementation use this template's environment settings.
Can be subclassed for custom contexts, e.g. for testing.

@return the initial Context instance
@throws NamingException in case of initialization errors
core/src/main/java/org/apache/shiro/jndi/JndiTemplate.java