### Question:
LocalFileGzipCompressor { public File compress(final String inputFileAbsolutePath) throws FileNotFoundException, JargonException { log.info("compress"); if (inputFileAbsolutePath == null || inputFileAbsolutePath.isEmpty()) { throw new IllegalArgumentException("null or empty inputFileAbsolutePath"); } log.info("inputFileAbsolutePath:{}", inputFileAbsolutePath); try { File inputFile = new File(inputFileAbsolutePath); if (!inputFile.exists()) { throw new FileNotFoundException("unable to find input file"); } StringBuilder sb = new StringBuilder(); sb.append(inputFile.getName()); sb.append(".gzip"); File outputFile = new File(inputFile.getParent(), sb.toString()); log.info("output file is:{}", outputFile); log.info("creating input stream..."); InputStream inputStream = new BufferedInputStream(new FileInputStream(inputFile)); OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)); log.info("creating gzip streams.."); GzipCompressorOutputStream gzOut = new GzipCompressorOutputStream(outputStream); log.info("stream copy"); IOUtils.copy(inputStream, gzOut); inputStream.close(); gzOut.close(); log.info("done!"); return outputFile; } catch (IOException e) { log.error("io exception in completeArchiving", e); throw new JargonException("io exception in completeArchiving", e); } }  File compress(final String inputFileAbsolutePath); File uncompress(final String inputFileAbsolutePath); static final Logger log; }### Answer:
@Test public void testTarAndGzip() throws Exception { String rootCollection = "testTarAndGzip"; String targetTarFile = "testTarAndGzip.tar"; String localCollectionAbsolutePath = scratchFileUtils .createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH + '/' + rootCollection); String tarParentCollection = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH); File tarFile = new File(tarParentCollection, targetTarFile); FileGenerator.generateManyFilesAndCollectionsInParentCollectionByAbsolutePath(localCollectionAbsolutePath, rootCollection, 2, 3, 2, "testFile", ".txt", 3, 2, 1, 200); LocalTarFileArchiver archiver = new LocalTarFileArchiver(localCollectionAbsolutePath, tarFile.getAbsolutePath()); File tarredFile = archiver.createArchive(); LocalFileGzipCompressor localFileGzipCompressor = new LocalFileGzipCompressor(); File zippedFile = localFileGzipCompressor.compress(tarredFile.getAbsolutePath()); Assert.assertNotNull("no file", zippedFile); Assert.assertTrue("compressed file does not exist", zippedFile.exists()); Assert.assertEquals("name should have .gzip appended", targetTarFile + ".gzip", zippedFile.getName()); }