GuavaTemplateCache implements TemplateCache { @Override public void clear() { cache.invalidateAll(); } 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 clear() throws IOException { @SuppressWarnings("unchecked") Cache<TemplateSource, Template> cache = createMock(Cache.class); cache.invalidateAll(); replay(cache); new GuavaTemplateCache(cache).clear(); verify(cache); }