@Test
public void testGzipContentEncoding() throws Exception {

    HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
    StringEntity original = new StringEntity("encoded stuff");
    original.setContentEncoding("GZip");
    response.setEntity(original);
    HttpContext context = new BasicHttpContext();
    HttpResponseInterceptor interceptor = new ResponseContentEncoding();
    interceptor.process(response, context);
    HttpEntity entity = response.getEntity();
    Assert.assertNotNull(entity);
    Assert.assertTrue(entity instanceof GzipDecompressingEntity);
}