SchedulerPoolFactory { static void tryPutIntoPool(boolean purgeEnabled, ScheduledExecutorService exec) { if (purgeEnabled && exec instanceof ScheduledThreadPoolExecutor) { ScheduledThreadPoolExecutor e = (ScheduledThreadPoolExecutor) exec; POOLS.put(e, exec); } } private  SchedulerPoolFactory(); static void start(); static void shutdown(); static ScheduledExecutorService create(ThreadFactory factory); static final boolean PURGE_ENABLED; static final int PURGE_PERIOD_SECONDS; }
@Test public void putIntoPoolNoPurge() { int s = SchedulerPoolFactory.POOLS.size(); SchedulerPoolFactory.tryPutIntoPool(false, null); assertEquals(s, SchedulerPoolFactory.POOLS.size()); }
@Test public void putIntoPoolNonThreadPool() { int s = SchedulerPoolFactory.POOLS.size(); SchedulerPoolFactory.tryPutIntoPool(true, null); assertEquals(s, SchedulerPoolFactory.POOLS.size()); }