HTTPResponse { public boolean isCached() { return cached; } HTTPResponse(Status status, Headers headers);  HTTPResponse(Optional<Payload> payload, Status status, Headers headers);  HTTPResponse(Optional<Payload> payload, StatusLine statusLine, Headers headers); @Internal HTTPResponse withHeaders(Headers headers); @Internal HTTPResponse withPayload(Payload payload); boolean hasPayload(); Status getStatus(); StatusLine getStatusLine(); Optional<Payload> getPayload(); Headers getHeaders(); boolean isCached(); Optional<A> transform(final ThrowableFunction<Payload, A, IOException> f); void consume(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void responseShouldHaveCachedValueSet() { Headers headers = new Headers().add(CacheHeaderBuilder.getBuilder().createHITXCacheHeader()); HTTPResponse response = new HTTPResponse(Status.OK, headers); assertTrue(response.isCached()); }