### Question:
ESProxyFilter implements Filter { protected boolean handleNotModifiedResponse(HttpServletResponse servletResponse, int statusCode) throws ServletException, IOException { if (statusCode == HttpServletResponse.SC_NOT_MODIFIED) { servletResponse.setIntHeader(HttpHeaders.CONTENT_LENGTH, 0); servletResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return true; } return false; }  @Override void init(FilterConfig filterConfig); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain);  }### Answer:
@Test public void handleNotModifiedResponse() throws ServletException, IOException { ESProxyFilter tested = getTested(); HttpServletResponse responseMock = Mockito.mock(HttpServletResponse.class); Assert.assertTrue(tested.handleNotModifiedResponse(responseMock, HttpServletResponse.SC_NOT_MODIFIED)); Mockito.verify(responseMock).setStatus(HttpServletResponse.SC_NOT_MODIFIED); Mockito.verify(responseMock).setIntHeader(HttpHeaders.CONTENT_LENGTH, 0); Mockito.reset(responseMock); Assert.assertFalse(tested.handleNotModifiedResponse(responseMock, HttpServletResponse.SC_OK)); Mockito.verifyZeroInteractions(responseMock); }