FederatingManager extends Manager { @Override public synchronized void startManager() { try { if (logger.isDebugEnabled()) { logger.debug("Starting the Federating Manager.... "); } executorService = executorServiceSupplier.get(); running = true; startManagingActivity(); messenger.broadcastManagerInfo(); } catch (Exception e) { running = false; throw new ManagementException(e); } } @VisibleForTesting  FederatingManager(ManagementResourceRepo repo, InternalDistributedSystem system,
      SystemManagementService service, InternalCache cache, StatisticsFactory statisticsFactory,
      StatisticsClock statisticsClock, MBeanProxyFactory proxyFactory, MemberMessenger messenger,
      ExecutorService executorService);   FederatingManager(ManagementResourceRepo repo, InternalDistributedSystem system,
      SystemManagementService service, InternalCache cache, StatisticsFactory statisticsFactory,
      StatisticsClock statisticsClock, MBeanProxyFactory proxyFactory, MemberMessenger messenger,
      Supplier<ExecutorService> executorServiceSupplier); @Override synchronized void startManager(); @Override synchronized void stopManager(); @Override boolean isRunning(); MemberMessenger getMessenger(); @VisibleForTesting MBeanProxyFactory getProxyFactory();  }
@Test public void startManagerGetsNewExecutorServiceFromSupplier() { @SuppressWarnings("unchecked") Supplier<ExecutorService> executorServiceSupplier = mock(Supplier.class); when(executorServiceSupplier.get()).thenReturn(mock(ExecutorService.class)); FederatingManager federatingManager = new FederatingManager(repo, system, service, cache, statisticsFactory, statisticsClock, proxyFactory, messenger, executorServiceSupplier); federatingManager.startManager(); verify(executorServiceSupplier).get(); }