Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15862)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15863)
@@ -62,4 +62,5 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 import java.util.stream.Stream;
 import java.util.zip.ZipFile;
@@ -240,16 +241,7 @@
         if (values == null)
             return null;
-        StringBuilder s = null;
-        for (Object a : values) {
-            if (a == null) {
-                a = "";
-            }
-            if (s != null) {
-                s.append(sep).append(a);
-            } else {
-                s = new StringBuilder(a.toString());
-            }
-        }
-        return s != null ? s.toString() : "";
+        return values.stream()
+                .map(v -> v != null ? v.toString() : "")
+                .collect(Collectors.joining(sep));
     }
 
@@ -1023,9 +1015,7 @@
     public static List<String> getMatches(final Matcher m) {
         if (m.matches()) {
-            List<String> result = new ArrayList<>(m.groupCount() + 1);
-            for (int i = 0; i <= m.groupCount(); i++) {
-                result.add(m.group(i));
-            }
-            return result;
+            return IntStream.rangeClosed(0, m.groupCount())
+                    .mapToObj(m::group)
+                    .collect(Collectors.toList());
         } else {
             return null;
@@ -1445,9 +1435,6 @@
     public static boolean hasExtension(String filename, String... extensions) {
         String name = filename.toLowerCase(Locale.ENGLISH).replace("?format=raw", "");
-        for (String ext : extensions) {
-            if (name.endsWith('.' + ext.toLowerCase(Locale.ENGLISH)))
-                return true;
-        }
-        return false;
+        return Arrays.stream(extensions)
+                .anyMatch(ext -> name.endsWith('.' + ext.toLowerCase(Locale.ENGLISH)));
     }
 
