@Test(expected = NullPointerException.class)
public void testWriteNull() throws IOException {

    StringWriter writer = new StringWriter();
    Request requestContext = EasyMock
            .createMock(Request.class);
    replay(requestContext, stringRenderer, templateRenderer,
            definitionRenderer);
    try {
        renderer.render(null, requestContext);
    } finally {
        writer.close();
        verify(requestContext, stringRenderer, templateRenderer,
                definitionRenderer);
    }
}