final HttpServletResponse mockResponse = createMock(HttpServletResponse.class);
expect(mockResponse.isCommitted())
.andReturn(true);
final HttpServlet mockServlet = new HttpServlet() {
protected void service(HttpServletRequest request, HttpServletResponse httpServletResponse)
throws ServletException, IOException {
final Object o = request.getAttribute(A_KEY);
assertEquals("Wrong attrib returned - " + o, A_VALUE, o);