StatisticsScheduler { void shutdown() { try { if (null != scheduler && !scheduler.isShutdown()) { scheduler.shutdown(); } } catch (final SchedulerException ex) { throw new JobStatisticException(ex); } } StatisticsScheduler();   }
@Test public void assertShutdown() throws SchedulerException { when(scheduler.isShutdown()).thenReturn(false); statisticsScheduler.shutdown(); when(scheduler.isShutdown()).thenReturn(true); statisticsScheduler.shutdown(); verify(scheduler).shutdown(); }