DispatchRenderer implements Renderer { public boolean isRenderable(String path, Request request) { return path != null && getDispatchRequest(request) != null && path.startsWith("/"); }  @Override void render(String path, Request request); boolean isRenderable(String path, Request request);  }
@Test public void testIsRenderable() { Request requestContext = createMock(DispatchRequest.class); replay(requestContext); assertTrue(renderer.isRenderable("/myTemplate.jsp", requestContext)); assertFalse(renderer.isRenderable(null, requestContext)); verify(requestContext); }