EventsCache { public void add(final EventsCacheKey key, final DeploymentEvent event) { EventsCacheValue eventsCacheValue = eventsLoadingCache.asMap().get(key); synchronized (eventsCacheValue.getMutex()) { DeploymentEvents events = eventsCacheValue.getEvents(); event.setIndex(eventsCacheValue.getLastEventIndex() + 1); logger.finest("Adding event " + event + " to cache value with key " + key); events.getEvents().add(event); } } EventsCache(final Admin admin); void setCacheExpirationPeriod(int cacheExpirationPeriod); void setCacheExpirationTimeunit(TimeUnit cacheExpirationTimeunit); void refresh(final EventsCacheKey key); EventsCacheValue get(final EventsCacheKey key); EventsCacheValue getIfExists(final EventsCacheKey key); void put(final EventsCacheKey key, final EventsCacheValue value); void add(final EventsCacheKey key, final DeploymentEvent event);  }
@Test public void testAdd() throws Exception { }