IoTDBThreadPoolFactory { public static ExecutorService newFixedThreadPool(int nthreads, String poolName) { logger.info("new fixed thread pool: {}, thread number: {}", poolName, nthreads); return Executors.newFixedThreadPool(nthreads, new IoTThreadFactory(poolName)); } private  IoTDBThreadPoolFactory(); static ExecutorService newFixedThreadPool(int nthreads, String poolName); static ExecutorService newFixedThreadPool(int nthreads, String poolName,
      Thread.UncaughtExceptionHandler handler); static ExecutorService newSingleThreadExecutor(String poolName); static ExecutorService newSingleThreadExecutor(String poolName,
      Thread.UncaughtExceptionHandler handler); static ExecutorService newCachedThreadPool(String poolName); static ExecutorService newCachedThreadPool(String poolName,
      Thread.UncaughtExceptionHandler handler); static ScheduledExecutorService newSingleThreadScheduledExecutor(String poolName); static ScheduledExecutorService newSingleThreadScheduledExecutor(String poolName,
      Thread.UncaughtExceptionHandler handler); static ScheduledExecutorService newScheduledThreadPool(int corePoolSize, String poolName); static ScheduledExecutorService newScheduledThreadPool(int corePoolSize, String poolName,
      Thread.UncaughtExceptionHandler handler); static ExecutorService createThriftRpcClientThreadPool(TThreadPoolServer.Args args, String poolName); static ExecutorService createThriftRpcClientThreadPool(TThreadPoolServer.Args args, String poolName,
      Thread.UncaughtExceptionHandler handler);  }
@Test public void testNewFixedThreadPool() throws InterruptedException, ExecutionException { String reason = "(can be ignored in Tests) NewFixedThreadPool"; Thread.UncaughtExceptionHandler handler = new TestExceptionHandler(reason); int threadCount = 4; latch = new CountDownLatch(threadCount); ExecutorService exec = IoTDBThreadPoolFactory .newFixedThreadPool(threadCount / 2, POOL_NAME, handler); for (int i = 0; i < threadCount; i++) { Runnable task = new TestThread(reason); exec.execute(task); } try { latch.await(); assertEquals(count.get(), threadCount); } catch (InterruptedException E) { fail(); } }