### Question:
ZipUtils { public static Set<String> unzipPathNames(BeanByteSource source) { ImmutableSet.Builder<String> entryNames = ImmutableSet.builder(); try (ZipInputStream in = new ZipInputStream(source.openStream())) { ZipEntry entry = in.getNextEntry(); while (entry != null) { validateZipPathName(DUMMY_PATH, entry); if (!entry.isDirectory()) { entryNames.add(entry.getName()); } in.closeEntry(); entry = in.getNextEntry(); } } catch (IOException ex) { throw new UncheckedIOException(ex); } return entryNames.build(); } private  ZipUtils(); static Set<String> unzipPathNames(BeanByteSource source); static Optional<ArrayByteSource> unzipPathNameInMemory(BeanByteSource source, String relativePathName); static void unzip(BeanByteSource source, Path path); static ArrayByteSource zipInMemory(List<? extends BeanByteSource> sources); static Map<String, ArrayByteSource> unpackInMemory(BeanByteSource source); static void unpackInMemory(BeanByteSource source, BiConsumer<String, ArrayByteSource> consumer); static Map<String, ArrayByteSource> unzipInMemory(BeanByteSource source); static void unzipInMemory(BeanByteSource source, BiConsumer<String, ArrayByteSource> consumer); static BeanByteSource decryptZip(BeanByteSource source, String password);  }### Answer:
@Test public void test_unzipPathNames() { ArrayByteSource zipFile = load("TestFolder.zip"); Set<String> names = ZipUtils.unzipPathNames(zipFile); assertThat(names).containsOnly("test/alpha/Alpha.txt", "test/beta/Beta1.txt", "test/beta/Beta2.txt"); }
@Test public void test_unzipPathNames_zipSlip() { ArrayByteSource zipFile = load("zip-slip.zip"); assertThatExceptionOfType(UncheckedIOException.class) .isThrownBy(() -> ZipUtils.unzipPathNames(zipFile)); }