GuavaTemplateCache implements TemplateCache { @Override public void evict(final TemplateSource source) { cache.invalidate(key(source)); } GuavaTemplateCache(final Cache<TemplateSource, Template> cache); @Override void clear(); @Override void evict(final TemplateSource source); @Override Template get(final TemplateSource source, final Parser parser); @Override GuavaTemplateCache setReload(final boolean reload);  }
@Test public void evict() throws IOException { TemplateSource source = createMock(TemplateSource.class); @SuppressWarnings("unchecked") Cache<TemplateSource, Template> cache = createMock(Cache.class); cache.invalidate(source); replay(cache, source); new GuavaTemplateCache(cache).evict(source); verify(cache, source); }