public static List<File> extractFilesInLibDirAndReturnFiles(File aJarFile, Predicate<JarEntry> extractFilter, File outputTmpDir) {
        List<File> newClassPath = new ArrayList<>();
        try (JarFile jarFile = new JarFile(aJarFile)) {

            List<File> extractedJars = jarFile.stream()
                    .filter(extractFilter)
                    .map(jarEntry -> {
                        String jarFileBaseName = FilenameUtils.getName(jarEntry.getName());
                        File targetFile = new File(outputTmpDir, jarFileBaseName);
                        return extractJarEntry(jarFile, jarEntry, targetFile);
                    })
                    .toList();

            // add deps in dir specified by `libDirManifestKey`
            newClassPath.addAll(extractedJars);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return newClassPath;
    }
@Test
    public void shouldExtractJars() throws Exception {
        File sourceFile = new File(PATH_WITH_HASHES + "test-agent.jar");
        Set<File> files = new HashSet<>(JarUtil.extractFilesInLibDirAndReturnFiles(sourceFile, jarEntry -> jarEntry.getName().endsWith(".class"), temporaryFolder));

        try (Stream<Path> directoryStream = Files.list(temporaryFolder.toPath())) {
            Set<File> actualFiles = directoryStream.map(Path::toFile).collect(Collectors.toSet());

            assertEquals(files, actualFiles);
            assertEquals(files.size(), 2);
            Set<String> fileNames = files.stream().map(File::getName).collect(Collectors.toSet());
            assertEquals(fileNames, Set.of("ArgPrintingMain.class", "HelloWorldStreamWriter.class"));
        }
    }