### Question:
PathUtil { public static final boolean isArchive(Path path) throws IOException { if (Files.exists(path) && Files.isRegularFile(path)) { try (ZipFile zip = new ZipFile(path.toFile())){ return true; } catch (ZipException e) { return false; } } return false; }  static void copyRecursively(final Path source, final Path target, boolean overwrite); static void deleteSilentlyRecursively(final Path path); static void deleteRecursively(final Path path); static final Path resolveSecurely(Path rootPath, String path); static final boolean isArchive(Path path); static final boolean isArchive(InputStream in); static List<ContentRepositoryElement> listFiles(final Path rootPath, Path tempDir, final ContentFilter filter); static Path createTempDirectory(Path dir, String prefix); static void unzip(Path zip, Path target); static String getFileExtension(Path path); static Path readFile(Path src, Path tempDir);  }### Answer:
@Test public void testIsArchive() throws Exception { Path archive = root.resolve("test.zip"); try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(archive))) { ZipEntry entry = new ZipEntry("overlay.xhtml"); out.putNextEntry(entry); try (InputStream in = this.getClass().getClassLoader().getResourceAsStream("overlay.xhtml")) { StreamUtils.copyStream(in, out); } out.closeEntry(); } Path simpleFile = root.resolve("overlay.zip"); Files.copy(this.getClass().getClassLoader().getResourceAsStream("overlay.xhtml"), simpleFile); Assert.assertTrue(PathUtil.isArchive(archive)); Assert.assertFalse(PathUtil.isArchive(root)); Assert.assertFalse(PathUtil.isArchive(simpleFile)); }