ConsulAdvertiserManager implements Managed { @Override public void stop() throws Exception { advertiser.deregister(); scheduler.ifPresent(ScheduledExecutorService::shutdownNow); } ConsulAdvertiserManager(
      final ConsulAdvertiser advertiser, final Optional<ScheduledExecutorService> scheduler); @Override void start(); @Override void stop();  }
@Test public void testStop() throws Exception { manager.stop(); verify(advertiser).deregister(); verify(scheduler).shutdownNow(); }