### Question:
UrlRewriteServletEnvironment implements UrlRewriteEnvironment { @Override public URL getResource( String name ) throws MalformedURLException { return context.getResource( name ); } UrlRewriteServletEnvironment( ServletContext context ); @Override URL getResource( String name ); @Override T getAttribute( String name ); @Override List<String> resolve( String name );  }### Answer:
@Test public void testGetResource() throws Exception { ServletContext context = EasyMock.createNiceMock( ServletContext.class ); EasyMock.expect( context.getResource( "test-resource-name" ) ).andReturn( new URL( "http:/test-resource-value" ) ).anyTimes(); EasyMock.replay( context ); UrlRewriteServletEnvironment env = new UrlRewriteServletEnvironment( context ); assertThat( env.getResource( "test-resource-name" ), is( new URL( "http:/test-resource-value" ) ) ); }