Index: trunk/src/org/openstreetmap/josm/tools/StreamUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/StreamUtils.java	(revision 10717)
+++ trunk/src/org/openstreetmap/josm/tools/StreamUtils.java	(revision 10718)
@@ -2,13 +2,5 @@
 package org.openstreetmap.josm.tools;
 
-import java.util.EnumSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Spliterator;
-import java.util.Spliterators;
-import java.util.function.BiConsumer;
-import java.util.function.BinaryOperator;
-import java.util.function.Function;
-import java.util.function.Supplier;
+import java.util.StringJoiner;
 import java.util.stream.Collector;
 import java.util.stream.Stream;
@@ -18,34 +10,6 @@
  * Utility methods for streams.
  * @author Michael Zangl
- * @since 10585
  */
 public final class StreamUtils {
-
-    private static final class HtmlListCollector implements Collector<String, StringBuilder, String> {
-        @Override
-        public Supplier<StringBuilder> supplier() {
-            return StringBuilder::new;
-        }
-
-        @Override
-        public BiConsumer<StringBuilder, String> accumulator() {
-            return (sb, item) -> sb.append("<li>").append(item).append("</li>");
-        }
-
-        @Override
-        public BinaryOperator<StringBuilder> combiner() {
-            return StringBuilder::append;
-        }
-
-        @Override
-        public Function<StringBuilder, String> finisher() {
-            return sb -> "<ul>" + sb.toString() + "</ul>";
-        }
-
-        @Override
-        public Set<Characteristics> characteristics() {
-            return EnumSet.of(Characteristics.CONCURRENT);
-        }
-    }
 
     /**
@@ -55,12 +19,12 @@
 
     /**
-     * Convert an iterator to a stream.
+     * Returns a sequential {@code Stream} with the iterable as its source.
      * @param <T> The element type to iterate over
-     * @param iterator The iterator
-     * @return The stream of for that iterator.
+     * @param iterable The iterable
+     * @return The stream of for that iterable.
+     * @since 10718
      */
-    public static <T> Stream<T> toStream(Iterator<? extends T> iterator) {
-        Spliterator<T> spliterator = Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED);
-        return StreamSupport.stream(spliterator, false);
+    public static <T> Stream<T> toStream(Iterable<T> iterable) {
+        return StreamSupport.stream(iterable.spliterator(), false);
     }
 
@@ -71,5 +35,8 @@
      */
     public static Collector<String, ?, String> toHtmlList() {
-        return new HtmlListCollector();
+        return Collector.of(
+                () -> new StringJoiner("</li><li>", "<ul><li>", "</li></ul>").setEmptyValue("<ul></ul>"),
+                StringJoiner::add, StringJoiner::merge, StringJoiner::toString
+        );
     }
 }
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10717)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10718)
@@ -319,5 +319,5 @@
      */
     public static String joinAsHtmlUnorderedList(Iterable<?> values) {
-        return StreamUtils.toStream(values.iterator()).map(Object::toString).collect(StreamUtils.toHtmlList());
+        return StreamUtils.toStream(values).map(Object::toString).collect(StreamUtils.toHtmlList());
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java	(revision 10717)
+++ trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java	(revision 10718)
@@ -257,5 +257,5 @@
      */
     public boolean mayHaveConcurrentSource() {
-        return StreamUtils.toStream(new CauseTraceIterator())
+        return StreamUtils.toStream(CauseTraceIterator::new)
                 .anyMatch(t -> t instanceof ConcurrentModificationException || t instanceof InvocationTargetException);
     }
