@Test
public void consumesBodyIfOriginSendsOneInResponseToHEAD() throws Exception {
HttpRequest req = new HttpHead("http://foo.example.com/");
int nbytes = 128;
HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
setMinimalResponseHeaders(resp);
resp.setHeader("Content-Length","" + nbytes);
final Flag closed = new Flag();
ByteArrayInputStream bais = makeTrackableBody(nbytes, closed);
resp.setEntity(new InputStreamEntity(bais, -1));
impl.ensureProtocolCompliance(req, resp);
assertNull(resp.getEntity());
assertTrue(closed.set || bais.read() == -1);
}