JarScanner: Fix StreamToIterable error prone issue

This was introduced by change Ib7600189f which fixed another error prone
issue. The StreamToIterable error prone pattern [1] is currently not
available in our build, but internally at Google it's considered an
error and hence this blocks the import for us (Google).

[1] https://errorprone.info/bugpattern/StreamToIterable

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I7d1f75dd137242b7ff5a11e09acb5281ac60ab45
diff --git a/java/com/google/gerrit/server/plugins/JarScanner.java b/java/com/google/gerrit/server/plugins/JarScanner.java
index 1704881..e119bf1 100644
--- a/java/com/google/gerrit/server/plugins/JarScanner.java
+++ b/java/com/google/gerrit/server/plugins/JarScanner.java
@@ -15,6 +15,7 @@
 package com.google.gerrit.server.plugins;
 
 import static com.google.common.base.MoreObjects.firstNonNull;
+import static com.google.common.collect.ImmutableList.toImmutableList;
 import static com.google.common.collect.Iterables.transform;
 
 import com.google.common.base.Strings;
@@ -329,6 +330,6 @@
   }
 
   private static Iterable<JarEntry> entriesOf(JarFile jarFile) {
-    return jarFile.stream()::iterator;
+    return jarFile.stream().collect(toImmutableList());
   }
 }