### Question:
TimeLimiterServiceImpl implements TimeLimiterService { @Override public TimeLimiter acquireLimiter(String name) { Preconditions.checkState(started, MESSAGE_THE_SERVICE_IS_SHUT_DOWN); LimiterEntry limiter = allocatedLimiters.get(name); if (limiter == null) { limiter = createLimiterEntry(name); allocatedLimiters.put(name, limiter); } return limiter.limiter; } 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 acquireLimiter() { String name = "FIRST_LIMITER"; assertNull(limiterService.getExecutor(name)); TimeLimiter limiter = limiterService.acquireLimiter(name); assertNotNull(limiter); assertNotNull(limiterService.getExecutor(name)); assertEquals(limiter, limiterService.acquireLimiter(name)); }