Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/Lanes.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/Lanes.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/Lanes.java	(revision 10638)
@@ -4,10 +4,7 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
 import java.util.Set;
-import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 import org.openstreetmap.josm.Main;
@@ -16,7 +13,5 @@
 import org.openstreetmap.josm.data.validation.Test;
 import org.openstreetmap.josm.data.validation.TestError;
-import org.openstreetmap.josm.tools.Predicates;
 import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -45,13 +40,11 @@
 
     protected void checkNumberOfLanesByKey(final OsmPrimitive p, String lanesKey, String message) {
-        final Collection<String> keysForPattern = new ArrayList<>(Utils.filter(p.keySet(),
-                Predicates.stringContainsPattern(Pattern.compile(':' + lanesKey + '$'))));
-        keysForPattern.removeAll(Arrays.asList(BLACKLIST));
-        if (keysForPattern.isEmpty()) {
-            // nothing to check
-            return;
-        }
-        final Set<Integer> lanesCount = new HashSet<>(Utils.transform(keysForPattern,
-                (Function<String, Integer>) key -> getLanesCount(p.get(key))));
+        final Set<Integer> lanesCount =
+                p.keySet().stream()
+                .filter(x -> x.endsWith(":" + lanesKey))
+                .filter(x -> !Arrays.asList(BLACKLIST).contains(x))
+                .map(key -> getLanesCount(p.get(key)))
+                .collect(Collectors.toSet());
+
         if (lanesCount.size() > 1) {
             // if not all numbers are the same
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java	(revision 10638)
@@ -12,4 +12,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 import org.openstreetmap.josm.command.Command;
@@ -29,5 +30,4 @@
 import org.openstreetmap.josm.gui.tagging.presets.items.Roles.Role;
 import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -256,5 +256,5 @@
 
             // convert in localization friendly way to string of accepted types
-            String typesStr = Utils.join("/", Utils.transform(types, (Function<TaggingPresetType, Object>) x -> tr(x.getName())));
+            String typesStr = types.stream().map(x -> tr(x.getName())).collect(Collectors.joining("/"));
 
             errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
@@ -293,5 +293,5 @@
         for (String key : map.keySet()) {
             if (!allroles.containsKey(key)) {
-                String templates = Utils.join("/", Utils.transform(allroles.keySet(), (Function<String, Object>) x -> tr(x)));
+                String templates = allroles.keySet().stream().map(x -> tr(x)).collect(Collectors.joining("/"));
 
                 if (!key.isEmpty()) {
Index: /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java	(revision 10638)
@@ -19,4 +19,5 @@
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import org.openstreetmap.josm.Main;
@@ -42,5 +43,4 @@
 import org.openstreetmap.josm.tools.I18n;
 import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -631,6 +631,5 @@
      */
     public String formatAsHtmlUnorderedList(Collection<? extends OsmPrimitive> primitives, int maxElements) {
-        final Collection<String> displayNames = Utils.transform(primitives,
-                (Function<OsmPrimitive, String>) x -> x.getDisplayName(this));
+        Collection<String> displayNames = primitives.stream().map(x -> x.getDisplayName(this)).collect(Collectors.toList());
         return Utils.joinAsHtmlUnorderedList(Utils.limit(displayNames, maxElements, "..."));
     }
Index: /trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java	(revision 10638)
@@ -22,4 +22,5 @@
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.swing.AbstractAction;
@@ -48,7 +49,6 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.StreamUtils;
 import org.openstreetmap.josm.tools.UserCancelException;
-import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 import org.openstreetmap.josm.tools.WindowGeometry;
 
@@ -569,7 +569,6 @@
             final Collection<? extends OsmPrimitive> primitives,
             final TagCollection normalizedTags) throws UserCancelException {
-        String conflicts = Utils.joinAsHtmlUnorderedList(Utils.transform(normalizedTags.getKeysWithMultipleValues(),
-                (Function<String, String>) key -> tr("{0} ({1})", key, Utils.join(tr(", "), Utils.transform(normalizedTags.getValues(key),
-                        (Function<String, String>) x -> x == null || x.isEmpty() ? tr("<i>missing</i>") : x)))));
+        String conflicts = normalizedTags.getKeysWithMultipleValues().stream().map(
+                key -> getKeyDescription(key, normalizedTags)).collect(StreamUtils.toHtmlList());
         String msg = /* for correct i18n of plural forms - see #9110 */ trn("You are about to combine {0} objects, "
                 + "but the following tags are used conflictingly:<br/>{1}"
@@ -594,3 +593,11 @@
         }
     }
+
+    private static String getKeyDescription(String key, TagCollection normalizedTags) {
+        String values = normalizedTags.getValues(key)
+                .stream()
+                .map(x -> ((x == null || x.isEmpty()) ? tr("<i>missing</i>") : x))
+                .collect(Collectors.joining(tr(", ")));
+        return tr("{0} ({1})", key, values);
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java	(revision 10638)
@@ -13,8 +13,8 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.EnumSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.swing.BorderFactory;
@@ -39,5 +39,4 @@
 import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
 import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 
 /**
@@ -204,9 +203,8 @@
         final List<SimplePrimitiveId> ids = SimplePrimitiveId.fuzzyParse(buf);
         if (!ids.isEmpty()) {
-            final String parsedText = Utils.join(", ", Utils.transform(ids,
-                    (Function<SimplePrimitiveId, String>) x -> x.getType().getAPIName().charAt(0) + String.valueOf(x.getUniqueId())));
+            final String parsedText = ids.stream().map(x -> x.getType().getAPIName().charAt(0) + String.valueOf(x.getUniqueId()))
+                    .collect(Collectors.joining(", "));
             tfId.tryToPasteFrom(parsedText);
-            final Set<OsmPrimitiveType> types = EnumSet.copyOf(Utils.transform(ids,
-                    (Function<SimplePrimitiveId, OsmPrimitiveType>) x -> x.getType()));
+            final Set<OsmPrimitiveType> types = ids.stream().map(x -> x.getType()).collect(Collectors.toSet());
             if (types.size() == 1) {
                 // select corresponding type
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java	(revision 10638)
@@ -17,4 +17,5 @@
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import javax.swing.AbstractAction;
@@ -53,6 +54,4 @@
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
@@ -301,6 +300,6 @@
         @Override
         public void actionPerformed(ActionEvent arg0) {
-            final List<PrimitiveId> primitiveIds = new ArrayList<>(Utils.transform(
-                    model.getSelectedPrimitives(), (Function<HistoryOsmPrimitive, PrimitiveId>) x -> x.getPrimitiveId()));
+            final List<PrimitiveId> primitiveIds = model.getSelectedPrimitives().stream().map(x -> x.getPrimitiveId())
+                    .collect(Collectors.toList());
             Main.worker.submit(new DownloadPrimitivesWithReferrersTask(false, primitiveIds, true, true, null, null));
         }
Index: /trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 10638)
@@ -7,12 +7,12 @@
 import java.text.MessageFormat;
 import java.text.ParseException;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import org.openstreetmap.josm.Main;
@@ -21,5 +21,4 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
-import org.openstreetmap.josm.tools.Utils.Function;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
@@ -405,7 +404,9 @@
 
         protected Collection<Long> parseLongs(String value) {
-            return value == null || value.isEmpty()
-                    ? Collections.<Long>emptySet() :
-                    new HashSet<>(Utils.transform(Arrays.asList(value.split(",")), (Function<String, Long>) x -> Long.valueOf(x)));
+            if (value == null || value.isEmpty()) {
+                return Collections.<Long>emptySet();
+            } else {
+                return Stream.of(value.split(",")).map(Long::valueOf).collect(Collectors.toSet());
+            }
         }
 
Index: /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 10638)
@@ -180,5 +180,5 @@
         return buildRootUrl() + "FORMAT=" + format + (imageFormatHasTransparency(format) ? "&TRANSPARENT=TRUE" : "")
                 + "&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS="
-                + Utils.join(",", Utils.transform(selectedLayers, x -> x.ident))
+                + selectedLayers.stream().map(x -> x.ident).collect(Collectors.joining(","))
                 + "&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}";
     }
Index: /trunk/src/org/openstreetmap/josm/tools/StreamUtils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/StreamUtils.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/tools/StreamUtils.java	(revision 10638)
@@ -2,7 +2,14 @@
 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.stream.Collector;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
@@ -14,4 +21,31 @@
  */
 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);
+        }
+    }
 
     /**
@@ -30,3 +64,12 @@
         return StreamSupport.stream(spliterator, false);
     }
+
+    /**
+     * Creates a new Collector that collects the items and returns them as HTML unordered list.
+     * @return The collector.
+     * @since 10638
+     */
+    public static Collector<String, ?, String> toHtmlList() {
+        return new HtmlListCollector();
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10637)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10638)
@@ -327,11 +327,5 @@
      */
     public static String joinAsHtmlUnorderedList(Iterable<?> values) {
-        StringBuilder sb = new StringBuilder(1024);
-        sb.append("<ul>");
-        for (Object i : values) {
-            sb.append("<li>").append(i).append("</li>");
-        }
-        sb.append("</ul>");
-        return sb.toString();
+        return StreamUtils.toStream(values.iterator()).map(x -> x.toString()).collect(StreamUtils.toHtmlList());
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java	(revision 10637)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/PresetClassificationsTest.java	(revision 10638)
@@ -10,4 +10,5 @@
 import java.util.EnumSet;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import org.junit.BeforeClass;
@@ -20,5 +21,4 @@
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSelector.PresetClassification;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSelector.PresetClassifications;
-import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -48,10 +48,5 @@
 
     private List<String> getMatchingPresetNames(String searchText, OsmPrimitive w) {
-        return Utils.transform(getMatchingPresets(searchText, w), new Utils.Function<PresetClassification, String>() {
-            @Override
-            public String apply(PresetClassification x) {
-                return x.preset.name;
-            }
-        });
+        return getMatchingPresets(searchText, w).stream().map(x -> x.preset.name).collect(Collectors.toList());
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 10637)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 10638)
@@ -5,8 +5,10 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.Collection;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import org.junit.Assert;
@@ -17,5 +19,4 @@
 import org.openstreetmap.josm.gui.tagging.presets.items.Check;
 import org.openstreetmap.josm.gui.tagging.presets.items.Key;
-import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
 
@@ -59,10 +60,6 @@
         assertThat(presets, hasSize(1));
         final TaggingPreset abc = presets.iterator().next();
-        final List<String> keys = Utils.transform(abc.data, new Utils.Function<TaggingPresetItem, String>() {
-            @Override
-            public String apply(TaggingPresetItem x) {
-                return x instanceof Key ? ((Key) x).key : null;
-            }
-        });
+        assertTrue(abc.data.stream().allMatch(Key.class::isInstance));
+        final List<String> keys = abc.data.stream().map(x -> ((Key) x).key).collect(Collectors.toList());
         assertEquals("[A1, A2, A3, B1, B2, B3, C1, C2, C3]", keys.toString());
     }
Index: /trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 10637)
+++ /trunk/test/unit/org/openstreetmap/josm/io/OsmWriterTest.java	(revision 10638)
@@ -2,5 +2,5 @@
 package org.openstreetmap.josm.io;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertArrayEquals;
 
 import java.util.ArrayList;
@@ -11,5 +11,4 @@
 import org.junit.Test;
 import org.openstreetmap.josm.data.osm.NodeData;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -33,12 +32,8 @@
         Collections.sort(ids, OsmWriter.byIdComparator);
 
-        final String idsAsString = Utils.transform(ids, new Utils.Function<NodeData, Object>() {
-            @Override
-            public Object apply(NodeData x) {
-                return x.getUniqueId();
-            }
-        }).toString();
-
-        assertEquals("[-3, -12, -20, -9223372036854775808, 0, 2, 12, 65, 9223372036854775807]", idsAsString);
+        final long[] longIds = ids.stream().mapToLong(x -> x.getUniqueId()).toArray();
+        assertArrayEquals(new long[] {
+                -3, -12, -20, -9223372036854775808L, 0, 2, 12, 65, 9223372036854775807L
+        }, longIds);
     }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 10637)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 10638)
@@ -8,4 +8,6 @@
 import java.net.URL;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 import java.util.Locale;
 
@@ -176,5 +178,5 @@
      */
     @Test
-    public void testSizeString() throws Exception {
+    public void testSizeString() {
         assertEquals("0 B", Utils.getSizeString(0, Locale.ENGLISH));
         assertEquals("123 B", Utils.getSizeString(123, Locale.ENGLISH));
@@ -189,7 +191,16 @@
      */
     @Test(expected = IllegalArgumentException.class)
-    public void testSizeStringNegative() throws Exception {
+    public void testSizeStringNegative() {
         Utils.getSizeString(-1, Locale.ENGLISH);
     }
 
+    /**
+     * Test {@link Utils#joinAsHtmlUnorderedList(Iterable)}
+     */
+    @Test
+    public void joinAsHtmlUnorderedList() {
+        List<? extends Object> items = Arrays.asList("1", new Integer(2));
+        assertEquals("<ul><li>1</li><li>2</li></ul>", Utils.joinAsHtmlUnorderedList(items));
+        assertEquals("<ul></ul>", Utils.joinAsHtmlUnorderedList(Collections.emptyList()));
+    }
 }
