class HttpResponseWrapper extends HttpServletResponseWrapper implements ResponseWithSessionId {

  @Override
  public PrintWriter getWriter() throws IOException {
    if (outputStream != null) {
      throw new IllegalStateException("Only one of getWriter()/getOutputStream() can be called, and output stream is already used.");
    }
    if (writer == null) {
      writer = wrapPrintWriter();
    }
    return writer;
  }

    HttpResponseWrapper(HttpRequestWrapper request, HttpServletResponse response);

}