@Override
   public InitialContextFactory createInitialContextFactory(Hashtable<?, ?> environment) throws NamingException {
      String className = environment != null ? (String) environment.get(Context.INITIAL_CONTEXT_FACTORY) : null;
      if (className == null) {
         return new ServerInitialContextFactory(namedObjects);
      }
      if (initialContextFactories.containsKey(className)) {
         return initialContextFactories.get(className);
      } else {
         return InitialContextFactory.class.cast(Util.getInstance(className, Thread.currentThread().getContextClassLoader()));
      }
   }
@Test
   public void testNoIllegalAccessJDKInitialContextFactories() throws NamingException {
      ServerInitialContextFactoryBuilder builder = new ServerInitialContextFactoryBuilder();
      Properties env = new Properties();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
      InitialContextFactory contextFactory = builder.createInitialContextFactory(env);
   }