class SourceZip {

    private final Path zipPath;

    private ParserConfiguration parserConfiguration;

    /**
     * Create a new ZIP parser. An instance of {@link JavaParser} with the default {@link ParserConfiguration} will be
     * used to parse the ZIP.
     *
     * @param zipPath The absolute path of ZIP file to parse.
     */
    public SourceZip(Path zipPath) {
        this(zipPath, new ParserConfiguration());
    }

    /**
     * Create a new ZIP parser. An instance of {@link JavaParser} with the given configuration will be used to parse
     * the ZIP.
     *
     * @param zipPath The absolute path of ZIP file to parse.
     * @param configuration The configuration to initiate the default parser with.
     */
    public SourceZip(Path zipPath, ParserConfiguration configuration) {
        assertNotNull(zipPath);
        assertNotNull(configuration);
        this.zipPath = zipPath.normalize();
        this.parserConfiguration = configuration;
        Log.info("New source zip at \"%s\"", () -> this.zipPath);
    }

    /**
     * Tries to parse all '.java' files in the ZIP located at this <i>SourceZip</i>'s path and returns the parse
     * results in a list.
     *
     * @return A list of path-compilation unit pairs.
     *
     * @throws IOException If an error occurs while trying to parse the given source.
     */
    public List<Pair<Path, ParseResult<CompilationUnit>>> parse() throws IOException {
        Log.info("Parsing zip at \"%s\"", () -> zipPath);
        List<Pair<Path, ParseResult<CompilationUnit>>> results = new ArrayList<>();
        parse((path, result) -> results.add(new Pair<>(path, result)));
        return results;
    }

    /**
     * Tries to parse all '.java' files in the ZIP located at this <i>SourceZip</i>'s path and returns the parse
     * results in a list.
     *
     * @return A list of path-compilation unit pairs.
     *
     * @throws IOException If an error occurs while trying to parse the given source.
     */
    public SourceZip parse(Callback callback) throws IOException {<FILL_FUNCTION_BODY>}

    /**
     * An interface to define a callback for each file that's parsed.
     */
    @FunctionalInterface
    public interface Callback {

        /**
         * Process the given parse result.
         *
         * @param relativeZipEntryPath The relative path of the entry in the ZIP file that was parsed.
         * @param result The parse result of file located at <i>absolutePath</i>.
         */
        void process(Path relativeZipEntryPath, ParseResult<CompilationUnit> result);
    }

    /**
     * Get the path of the ZIP file to be parsed.
     *
     * @return The absolute path of this ZIP file.
     */
    public Path getZipPath() {
        return zipPath;
    }

    public ParserConfiguration getParserConfiguration() {
        return parserConfiguration;
    }

    public SourceZip setParserConfiguration(ParserConfiguration parserConfiguration) {
        assertNotNull(parserConfiguration);
        this.parserConfiguration = parserConfiguration;
        return this;
    }
}

        Log.info("Parsing zip at \"%s\"", () -> zipPath);
        JavaParser javaParser = new JavaParser(parserConfiguration);
        try (ZipFile zipFile = new ZipFile(zipPath.toFile())) {
            for (ZipEntry entry : Collections.list(zipFile.entries())) {
                if (!entry.isDirectory() && entry.getName().endsWith(".java")) {
                    Log.info("Parsing zip entry \"%s\"", () -> entry.getName());
                    final ParseResult<CompilationUnit> result = javaParser.parse(COMPILATION_UNIT, provider(zipFile.getInputStream(entry)));
                    callback.process(Paths.get(entry.getName()), result);
                }
            }
        }
        return this;
    
<no_super_class>