static JarFileWithEntryClass findOnlyEntryClass(Iterable<File> jarFiles) throws IOException {
        List<JarFileWithEntryClass> jarsWithEntryClasses = new ArrayList<>();
        for (File jarFile : jarFiles) {
            findEntryClass(jarFile)
                    .ifPresent(
                            entryClass ->
                                    jarsWithEntryClasses.add(
                                            new JarFileWithEntryClass(jarFile, entryClass)));
        }
        int size = jarsWithEntryClasses.size();
        if (size == 0) {
            throw new NoSuchElementException("No JAR with manifest attribute for entry class");
        }
        if (size == 1) {
            return jarsWithEntryClasses.get(0);
        }
        // else: size > 1
        throw new IllegalArgumentException(
                "Multiple JARs with manifest attribute for entry class: " + jarsWithEntryClasses);
    }
@Test
    void testFindOnlyEntryClassMultipleJarsWithSingleManifestEntry() throws IOException {
        File jarWithNoManifest = createJarFileWithManifest(ImmutableMap.of());
        File jarFile = TestJob.getTestJobJar();

        JarManifestParser.JarFileWithEntryClass jarFileWithEntryClass =
                JarManifestParser.findOnlyEntryClass(ImmutableList.of(jarWithNoManifest, jarFile));

        assertThat(jarFileWithEntryClass.getEntryClass())
                .isEqualTo(TestJob.class.getCanonicalName());
    }