### Question:
RedirectedStreamServletResponseWrapper extends HttpServletResponseWrapper { @Override public ServletOutputStream getOutputStream() throws IOException { return servletOutputStream; } RedirectedStreamServletResponseWrapper(final OutputStream outputStream, final HttpServletResponse response); @Override void sendError(final int sc); @Override void sendError(final int sc, final String msg); @Override void sendRedirect(final String location); @Override ServletOutputStream getOutputStream(); @Override void setStatus(final int sc); @Override PrintWriter getWriter();  }### Answer:
@Test public void shouldRedirectStream() throws Exception { final String message = "Hello world!"; victim.getOutputStream().write(message.getBytes()); victim.getOutputStream().flush(); Assert.assertEquals(message, new String(redirectedStream.toByteArray())); }