HTTPCacheHelper { Headers removeUnmodifiableHeaders(Headers headers) { Headers washedHeaders = new Headers(); Set<String> usableHeaders = new HashSet<>(headers.keySet()); usableHeaders.removeAll(unmodifiableHeaders); for (String headerName : usableHeaders) { if (headers.contains(headerName)) { washedHeaders = washedHeaders.add(headers.getHeaders((headerName))); } } return washedHeaders; } HTTPCacheHelper(CacheHeaderBuilder cacheHeaderBuilder);   }
@Test public void makesureWeAreRemovingUncachableHeaders() { Headers headers = new Headers().add("Connection", "close").add("Transfer-Encoding", "compress"); Headers modified = helper.removeUnmodifiableHeaders(headers); assertEquals(new Headers(), modified); }