class GuavaCachedTemplateLoader implements TemplateLoader {

  public static GuavaCachedTemplateLoader cacheWithExpiration(
      final TemplateLoader delegate, final long duration, final TimeUnit unit) {
    Cache<String, TemplateSource> cache = CacheBuilder.newBuilder()
        .expireAfterAccess(duration, unit).build();
    return new GuavaCachedTemplateLoader(delegate, cache);
  }

  public  GuavaCachedTemplateLoader(final TemplateLoader delegate,
      final Cache<String, TemplateSource> cache);

}