### Question:
ConfigurableDispatch extends DefaultDispatch { @Configure protected void setResponseExcludeHeaders(@Default(" ") String headers) { if (!" ".equals(headers)) { final Set<String> headerSet = convertCommaDelimitedHeadersToSet(headers); populateSetCookieHeaderDirectiveExlusions(headerSet); populateHttpHeaderExlusionsOtherThanSetCookie(headerSet); } }  @Override Set<String> getOutboundResponseExcludeHeaders(); @Override Set<String> getOutboundResponseExcludedSetCookieHeaderDirectives(); @Override Set<String> getOutboundRequestExcludeHeaders(); boolean getRemoveUrlEncoding(); @Override URI getDispatchUrl(HttpServletRequest request);  }### Answer:
@Test public void testResponseExcludeHeadersConfig() { ConfigurableDispatch dispatch = new ConfigurableDispatch(); dispatch.setResponseExcludeHeaders(String.join(",", Arrays.asList("test", "caseINSENSITIVEheader"))); Header[] headers = new Header[]{ new BasicHeader(SET_COOKIE, "abc"), new BasicHeader(WWW_AUTHENTICATE, "negotiate"), new BasicHeader("TEST", "testValue"), new BasicHeader("caseInsensitiveHeader", "caseInsensitiveHeaderValue") }; HttpResponse inboundResponse = EasyMock.createNiceMock(HttpResponse.class); EasyMock.expect(inboundResponse.getAllHeaders()).andReturn(headers).anyTimes(); EasyMock.replay(inboundResponse); HttpServletResponse outboundResponse = new MockHttpServletResponse(); dispatch.copyResponseHeaderFields(outboundResponse, inboundResponse); assertThat(outboundResponse.getHeaderNames().size(), is(2)); assertThat(outboundResponse.getHeader(SET_COOKIE), is("abc")); assertThat(outboundResponse.getHeader(WWW_AUTHENTICATE), is("negotiate")); }
@Test public void shouldExcludeCertainPartsFromSetCookieHeader() throws Exception { final Header[] headers = new Header[] { new BasicHeader(SET_COOKIE, "Domain=localhost; Secure; HttpOnly; Max-Age=1") }; final HttpResponse inboundResponse = EasyMock.createNiceMock(HttpResponse.class); EasyMock.expect(inboundResponse.getAllHeaders()).andReturn(headers).anyTimes(); EasyMock.replay(inboundResponse); final ConfigurableDispatch dispatch = new ConfigurableDispatch(); final String setCookieExludeHeaders = SET_COOKIE + ": Domain=localhost; HttpOnly"; dispatch.setResponseExcludeHeaders(setCookieExludeHeaders); final HttpServletResponse outboundResponse = new MockHttpServletResponse(); dispatch.copyResponseHeaderFields(outboundResponse, inboundResponse); assertThat(outboundResponse.getHeaderNames().size(), is(1)); assertThat(outboundResponse.getHeader(SET_COOKIE), is("Secure; Max-Age=1")); }