HttpServletResponseWrapper extends HttpServerResponse { @Override public int statusCode() { int result = ServletRuntime.get().status(response); if (caught != null && result == 200) { if (caught instanceof UnavailableException) { return ((UnavailableException) caught).isPermanent() ? 404 : 503; } return 500; } return result; } HttpServletResponseWrapper(@Nullable HttpServletRequest request, HttpServletResponse response,
    @Nullable Throwable caught); static HttpServerResponse create(@Nullable HttpServletRequest request,
    HttpServletResponse response, @Nullable Throwable caught); @Override final Object unwrap(); @Override @Nullable HttpServletRequestWrapper request(); @Override Throwable error(); @Override int statusCode();  }
@Test public void statusCode() { when(response.getStatus()).thenReturn(200); HttpServerResponse wrapper = HttpServletResponseWrapper.create(request, response, null); assertThat(wrapper.statusCode()).isEqualTo(200); }