ZipUtil { public static void createZip(Collection<ItemToArchive> items, File outputFile) throws IOException { final ZipArchiveOutputStream zaos = new ZipArchiveOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile))); addFilesToZip(items, zaos); zaos.finish(); zaos.close(); }  static void createZip(Collection<ItemToArchive> items, File outputFile); static void unzipToDir(File zipFile, File toDir); static void unzipToDir(InputStream is, File toDir);  }
@Test public void testZipStrings() throws Exception { Collection<ItemToArchive> items = getExampleItemsCollection(); File outputFile = tmpFolder.newFile(); ZipUtil.createZip(items, outputFile); Map<String, String> contents = readZipFileContents(outputFile); assertMapsEqual(stringContents, contents); }