### Question:
HttpCacheServletResponseWrapper extends SlingHttpServletResponseWrapper { @Override public Collection<String> getHeaderNames() { try { return super.getHeaderNames(); } catch (AbstractMethodError e) { log.debug("Known issue when internal sling redirects are made - the call to getHeaders() will throw an exception.", e); return Collections.EMPTY_LIST; } } HttpCacheServletResponseWrapper(SlingHttpServletResponse wrappedResponse, TempSink tempSink); @Override @SuppressWarnings("squid:S2095") // closing is responsibility of caller ServletOutputStream getOutputStream(); @Override @SuppressWarnings("squid:S2095") // closing is responsibility of caller PrintWriter getWriter(); @Override Collection<String> getHeaderNames(); TempSink getTempSink(); ResponseWriteMethod getWriteMethod();  }### Answer:
@Test public void getHeaderNames_NullHeaderNames() throws IOException { TempSink tempSink = new MemTempSinkImpl(); when(response.getHeaderNames()).thenThrow(AbstractMethodError.class); HttpCacheServletResponseWrapper systemUnderTest = new HttpCacheServletResponseWrapper(response, tempSink); assertEquals(0, systemUnderTest.getHeaderNames().size()); }