I've looked at other questions and tried to correct the code in ways that were suggest by those and it is not passing, still. public List<FileProperties> getFileList() throws Exception { if (!Files.isRegularFile(zipFile)) throw new NoSuchZipFileException(); List<FileProperties> files = new ArrayList<>(); try (ZipInputStream zipInputStream = new ZipInputStream(Files.newInputStream(zipFile))) { ZipEntry zipEntry; while ((zipEntry = zipInputStream.getNextEntry()) != null) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); copyData(zipInputStream, baos); files.add(new FileProperties(zipEntry.getName(), zipEntry.getSize(), zipEntry.getCompressedSize(), zipEntry.getMethod())); } zipInputStream.closeEntry(); } return files; }