ConcurrentMapTemplateCache implements TemplateCache { @Override public Template get(final TemplateSource source, final Parser parser) throws IOException { notNull(source, "The source is required."); notNull(parser, "The parser is required."); return cacheGet(source, parser); } protected  ConcurrentMapTemplateCache(
      final ConcurrentMap<TemplateSource, Pair<TemplateSource, Template>> cache);  ConcurrentMapTemplateCache(); @Override void clear(); @Override void evict(final TemplateSource source); @Override Template get(final TemplateSource source, final Parser parser); @Override ConcurrentMapTemplateCache setReload(final boolean reload);  }
@Test public void get() throws IOException { ConcurrentMap<TemplateSource, Pair<TemplateSource, Template>> cache = new ConcurrentHashMap<>(); TemplateSource source = new URLTemplateSource("/template.hbs", getClass().getResource( "/template.hbs")); Template template = createMock(Template.class); Parser parser = createMock(Parser.class); expect(parser.parse(source)).andReturn(template); replay(parser, template); assertEquals(template, new ConcurrentMapTemplateCache(cache).get(source, parser)); assertEquals(template, new ConcurrentMapTemplateCache(cache).get(source, parser)); verify(parser, template); }