ForwardingTemplateSource extends AbstractTemplateSource { @Override public String filename() { return source.filename(); } ForwardingTemplateSource(final TemplateSource source); @Override String content(final Charset charset); @Override String filename(); @Override long lastModified();  }
@Test public void filename() throws IOException { String filename = "filename"; TemplateSource source = createMock(TemplateSource.class); expect(source.filename()).andReturn(filename); replay(source); assertEquals("filename", new ForwardingTemplateSource(source).filename()); verify(source); }