private boolean jarIsEmpty(Path path) throws IOException {
        Objects.requireNonNull(path, "path must be non-null");
        try (ZipInputStream stream = new ZipInputStream(Files.newInputStream(
                path,
                StandardOpenOption.READ
        ))) {
            return stream.getNextEntry() == null;
        }
    }
Rewrite a jar on disk to have manifests with the specified entries.
Will create the jar file if it does not exist and at least one manifest element is specified.
Will delete the jar file if it exists, and would otherwise remain empty.

@param dryRun           True if the rewrite should be applied, false if it should be simulated.
@param jarPath          Path to a jar file for a plugin
@param manifestElements Map from plugin type to Class names of plugins which should appear in that manifest
tools/src/main/java/org/apache/kafka/tools/ManifestWorkspace.java