### Question:
CompressedHelper { public static Decompressor getCompressorInstance(@NonNull Context context, @NonNull File file) { Decompressor decompressor; String type = getExtension(file.getPath()); if (isZip(type)) { decompressor = new ZipDecompressor(context); } else if (isRar(type)) { decompressor = new RarDecompressor(context); } else if (isTar(type)) { decompressor = new TarDecompressor(context); } else if (isGzippedTar(type)) { decompressor = new GzipDecompressor(context); } else if (isBzippedTar(type)) { decompressor = new Bzip2Decompressor(context); } else if (isXzippedTar(type)) { decompressor = new XzDecompressor(context); } else if (isLzippedTar(type)) { decompressor = new LzmaDecompressor(context); } else if (is7zip(type)) { decompressor = new SevenZipDecompressor(context); } else { return null; } decompressor.setFilePath(file.getPath()); return decompressor; }  static Extractor getExtractorInstance(
      @NonNull Context context,
      @NonNull File file,
      @NonNull String outputPath,
      @NonNull Extractor.OnUpdate listener); static Decompressor getCompressorInstance(@NonNull Context context, @NonNull File file); static boolean isFileExtractable(String path); static String getFileName(String compressedName); static final boolean isEntryPathValid(String entryPath); static final char SEPARATOR_CHAR; static final String SEPARATOR; static final String fileExtensionZip; static final String fileExtensionTar; static final String fileExtensionGzipTarLong; static final String fileExtensionBzip2TarLong; static final String fileExtensionRar; static final String fileExtension7zip; static final String fileExtensionLzma; static final String fileExtensionXz; }### Answer:
@Test public void getCompressorInstance() { File file = new File("/test/test.zip"); Decompressor result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), ZipDecompressor.class); file = new File("/test/test.jar"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), ZipDecompressor.class); file = new File("/test/test.apk"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), ZipDecompressor.class); file = new File("/test/test.tar"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), TarDecompressor.class); file = new File("/test/test.tar.gz"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), GzipDecompressor.class); file = new File("/test/test.tgz"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), GzipDecompressor.class); file = new File("/test/test.rar"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), RarDecompressor.class); file = new File("/test/test.tar.bz2"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), Bzip2Decompressor.class); file = new File("/test/test.tbz"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), Bzip2Decompressor.class); file = new File("/test/test.7z"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), SevenZipDecompressor.class); file = new File("/test/test.tar.xz"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), XzDecompressor.class); file = new File("/test/test.tar.lzma"); result = CompressedHelper.getCompressorInstance(context, file); assertEquals(result.getClass(), LzmaDecompressor.class); }