HiccupMeter { @PreDestroy public void shutdown() { doRun = false; sensors.forEach(HiccupSensor::shutdown); if (controller.isAlive()) { try { controller.join(); } catch (InterruptedException e) { logger.warn("HiccupMeter terminate/join interrupted"); } } } @Inject  HiccupMeter(HiccupRecorderConfiguration configuration, Registry registry); @PreDestroy void shutdown();  }
@Test public void testStartupShutdownSequence() throws Exception { HiccupMeter hiccupMeter = new HiccupMeter(config, new DefaultRegistry()); hiccupMeter.shutdown(); }