### Question:
TimeLimiterServiceImpl implements TimeLimiterService { @Override public void shutdown() { if (started) { started = false; Enumeration<String> keys = allocatedLimiters.keys(); Collections.asList(keys).forEach(name -> Tasks.shutdownExecutor(name, allocatedLimiters.get(name).executor, 5)); } else { log.warn("The service is already shut down."); } } TimeLimiterServiceImpl(); @Override TimeLimiter acquireLimiter(String name); @Override void shutdown(); ExecutorService getExecutor(String name); static final String MESSAGE_THE_SERVICE_IS_SHUT_DOWN; }### Answer:
@Test void shutdown() { String name = "FIRST_LIMITER"; TimeLimiter limiter = limiterService.acquireLimiter(name); assertNotNull(limiter); limiterService.shutdown(); ExecutorService executor = limiterService.getExecutor(name); assertNotNull(executor); assertTrue(executor.isShutdown()); }