### Question:
ZipUtil { public static void unzip(Path archive, Path destination) throws IOException { String canonicalDestination = destination.toFile().getCanonicalPath(); try (InputStream fileIn = new BufferedInputStream(Files.newInputStream(archive)); ZipInputStream zipIn = new ZipInputStream(fileIn)) { for (ZipEntry entry = zipIn.getNextEntry(); entry != null; entry = zipIn.getNextEntry()) { Path entryPath = destination.resolve(entry.getName()); String canonicalTarget = entryPath.toFile().getCanonicalPath(); if (!canonicalTarget.startsWith(canonicalDestination + File.separator)) { String offender = entry.getName() + " from " + archive; throw new IOException("Blocked unzipping files outside destination: " + offender); } if (entry.isDirectory()) { Files.createDirectories(entryPath); } else { if (entryPath.getParent() != null) { Files.createDirectories(entryPath.getParent()); } try (OutputStream out = new BufferedOutputStream(Files.newOutputStream(entryPath))) { ByteStreams.copy(zipIn, out); } } } } }  static void unzip(Path archive, Path destination);  }### Answer:
@Test public void testUnzip() throws URISyntaxException, IOException { verifyUnzip(tempFolder.getRoot().toPath()); }