HTTPCacheHelper { boolean isCacheableResponse(HTTPResponse response) { if (!cacheableStatuses.contains(response.getStatus())) { return false; } Headers headers = response.getHeaders(); return headers.isCachable(); } HTTPCacheHelper(CacheHeaderBuilder cacheHeaderBuilder);   }
@Test public void testNotCacheableResponses() { Headers headers = new Headers(); headers = headers.add(HeaderUtils.toHttpDate("date", createDateTime(10))); headers = headers.add(HeaderConstants.CACHE_CONTROL, "private, max-age=39"); assertFalse("Response was cacheable", helper.isCacheableResponse(new HTTPResponse(Status.NOT_MODIFIED, headers))); assertFalse("Response was cacheable", helper.isCacheableResponse(new HTTPResponse(Status.ACCEPTED, headers))); assertFalse("Response was cacheable", helper.isCacheableResponse(new HTTPResponse(Status.CREATED, headers))); }