@Test
public void testIsGzipped() {

  assertThat(AmazonS3Downloader.isGZipped(null)).isFalse();
  final S3Object object = new S3Object();
  assertThat(AmazonS3Downloader.isGZipped(object)).isFalse();
  final ObjectMetadata metadata = object.getObjectMetadata();
  metadata.setContentEncoding("gzip");
  assertThat(AmazonS3Downloader.isGZipped(object)).isTrue();
  metadata.setContentEncoding("GZIP");
  assertThat(AmazonS3Downloader.isGZipped(object)).isTrue();
  metadata.setContentEncoding(" GzIP ");
  assertThat(AmazonS3Downloader.isGZipped(object)).isTrue();
  metadata.setContentEncoding(null);
  object.setKey("test");
  assertThat(AmazonS3Downloader.isGZipped(object)).isFalse();
  object.setKey("test.gz");
  assertThat(AmazonS3Downloader.isGZipped(object)).isTrue();
  object.setKey("test.gz   ");
  assertThat(AmazonS3Downloader.isGZipped(object)).isTrue();
  object.setKey("test.GZ ");
  assertThat(AmazonS3Downloader.isGZipped(object)).isTrue();
}