HystrixTimer { public static void reset() { ScheduledExecutor ex = INSTANCE.executor.getAndSet(null); if (ex != null && ex.getThreadPool() != null) { ex.getThreadPool().shutdownNow(); } } private  HystrixTimer(); static HystrixTimer getInstance(); static void reset(); Reference<TimerListener> addTimerListener(final TimerListener listener);  }
@Test public void testReset() { HystrixTimer timer = HystrixTimer.getInstance(); TestListener l1 = new TestListener(50, "A"); timer.addTimerListener(l1); ScheduledExecutor ex = timer.executor.get(); assertFalse(ex.executor.isShutdown()); HystrixTimer.reset(); assertTrue(ex.executor.isShutdown()); assertNull(timer.executor.get()); TestListener l2 = new TestListener(50, "A"); timer.addTimerListener(l2); ScheduledExecutor ex2 = timer.executor.get(); assertFalse(ex2.executor.isShutdown()); HystrixTimer.reset(); HystrixTimer.reset(); }