    @Test
    public void testCreateInstance() throws Exception {

        int threads = 100;
        ThreadPoolConfig cfg = new ThreadPoolConfig("test", -1, threads,
                null, -1, 0, null, null, Thread.NORM_PRIORITY, null);
        GrizzlyExecutorService r = GrizzlyExecutorService.createInstance(cfg);        
        final int tasks = 2000000;
        doTest(r,tasks);
        assertTrue(r.getMaximumPoolSize() == threads);
        assertTrue(r.getActiveCount() == 0);
        assertTrue(r.getCompletedTaskCount() == 0);
        assertTrue(r.getMaxQueuedTasksCount() == cfg.getQueueLimit());
        int jver = Integer.valueOf(System.getProperty("java.version").substring(0,3).replace(".", ""));
        assertTrue(jver < 16 || r.getQueue().getClass().getSimpleName().contains("LinkedTransferQueue"));

        doTest(r.reconfigure(r.getConfiguration().setQueueLimit(tasks)),tasks);
        assertTrue(r.getMaxQueuedTasksCount() == tasks);

        int coresize = r.getConfiguration().getMaxPoolSize()+1;
        doTest( r.reconfigure(r.getConfiguration().
                setQueue(new LinkedList<Runnable>()).
                setCorePoolSize(coresize).
                setKeepAliveTime(1, TimeUnit.MILLISECONDS).
                setMaxPoolSize(threads+=50)),tasks);
        assertTrue(r.getQueue().getClass().getSimpleName().contains("LinkedList"));
        assertTrue(r.getName() == cfg.getPoolName());
        assertTrue(r.getMaxQueuedTasksCount() == tasks);
        assertTrue(r.getCorePoolSize() == coresize);
        assertTrue(r.getMaximumPoolSize() == threads);
        r.shutdownNow();
       /* long a = r.getCompletedTaskCount();
        assertTrue(a+"!="+tasks,a == tasks);*/
    }