CompressionUtil { public static boolean isAlgorithmSupported(String algorithm) { return (Algorithm.findByName(algorithm) != null); }  static boolean isAlgorithmSupported(String algorithm); static boolean isFileExtensionSupported(String fileExt); static File compress(File sourceFile, String algorithm, boolean deleteSourceFileAfterCompressed); static File compress(File sourceFile, File targetDir, String algorithm, boolean deleteSourceFileAfterCompressed); static File uncompress(File sourceFile, boolean deleteSourceFileAfterUncompressed); static File uncompress(File sourceFile, File targetDir, boolean deleteSourceFileAfterUncompressed);  }
@Test public void isAlgorithmSupported() throws Exception { Assert.assertEquals(true, CompressionUtil.isAlgorithmSupported("gzip")); Assert.assertEquals(true, CompressionUtil.isAlgorithmSupported("zip")); Assert.assertEquals(false, CompressionUtil.isAlgorithmSupported("gzip2")); }