public static boolean isFileExtractable(String path) {
    String type = getExtension(path);

    return isZip(type)
        || isTar(type)
        || isRar(type)
        || isGzippedTar(type)
        || is7zip(type)
        || isBzippedTar(type)
        || isXzippedTar(type)
        || isLzippedTar(type)
        || isBzip2(type)
        || isGzip(type)
        || isLzma(type)
        || isXz(type);
  }
@Test
  public void isFileExtractableTest() throws Exception {
    // extension in code. So, it return true
    assertTrue(CompressedHelper.isFileExtractable("/test/test.zip"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.rar"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.tar"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.tar.gz"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.tgz"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.tar.bz2"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.tbz"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.tar.lzma"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.jar"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.apk"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.7z"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.txt.gz"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.txt.bz2"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.txt.lzma"));
    assertTrue(CompressedHelper.isFileExtractable("/test/test.txt.xz"));

    // extension not in code. So, it return false
    assertFalse(CompressedHelper.isFileExtractable("/test/test.z"));
  }