Index: trunk/src/org/openstreetmap/josm/actions/RestorePropertyAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RestorePropertyAction.java	(revision 17772)
+++ trunk/src/org/openstreetmap/josm/actions/RestorePropertyAction.java	(revision 17773)
@@ -6,7 +6,8 @@
 import java.awt.event.ActionEvent;
 import java.util.Collections;
-import java.util.HashMap;
+import java.util.Map;
 import java.util.function.IntFunction;
 import java.util.function.Supplier;
+import java.util.stream.Collectors;
 
 import javax.swing.AbstractAction;
@@ -54,8 +55,6 @@
         if (primitive == null) return;
 
-        HashMap<String, String> changes = new HashMap<>();
-        for (int index : TableHelper.getSelectedIndices(selectionModel)) {
-            changes.put(keyFn.apply(index), valueFn.apply(index));
-        }
+        Map<String, String> changes = TableHelper.selectedIndices(selectionModel).boxed()
+                .collect(Collectors.toMap(keyFn::apply, valueFn::apply, (a, b) -> b));
         ChangePropertyCommand command = new ChangePropertyCommand(Collections.singleton(primitive), changes);
         UndoRedoHandler.getInstance().add(command);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 17772)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 17773)
@@ -90,5 +90,4 @@
 import org.openstreetmap.josm.gui.widgets.ScrollableTable;
 import org.openstreetmap.josm.spi.preferences.Config;
-import org.openstreetmap.josm.tools.ArrayUtils;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
@@ -892,5 +891,5 @@
          */
         public List<Integer> getSelectedRows() {
-            return ArrayUtils.toList(TableHelper.getSelectedIndices(selectionModel));
+            return TableHelper.selectedIndices(selectionModel).boxed().collect(Collectors.toList());
         }
 
@@ -905,7 +904,6 @@
             layer.removePropertyChangeListener(this);
             final int size = getRowCount();
-            final int[] rows = TableHelper.getSelectedIndices(selectionModel);
-
-            if (rows.length == 0 && size > 0) {
+
+            if (selectionModel.isSelectionEmpty() && size > 0) {
                 selectionModel.setSelectionInterval(size-1, size-1);
             }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 17772)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java	(revision 17773)
@@ -3,5 +3,4 @@
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.BitSet;
 import java.util.Collection;
@@ -51,5 +50,4 @@
 import org.openstreetmap.josm.gui.util.SortableTableModel;
 import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTableModel;
-import org.openstreetmap.josm.tools.ArrayUtils;
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.bugreport.BugReport;
@@ -513,5 +511,5 @@
      */
     public Collection<RelationMember> getSelectedMembers() {
-        return Arrays.stream(getSelectedIndices())
+        return selectedIndices()
                 .mapToObj(members::get)
                 .collect(Collectors.toList());
@@ -692,8 +690,5 @@
         addToSelectedMembers(selected);
         getSelectionModel().setValueIsAdjusting(false);
-        int[] selectedIndices = getSelectedIndices();
-        if (selectedIndices.length > 0) {
-            fireMakeMemberVisible(selectedIndices[0]);
-        }
+        selectedIndices().findFirst().ifPresent(this::fireMakeMemberVisible);
     }
 
@@ -723,5 +718,5 @@
         } else {
             sortedMembers = relationSorter.sortMembers(selectedMembers);
-            List<Integer> selectedIndices = ArrayUtils.toList(getSelectedIndices());
+            List<Integer> selectedIndices = selectedIndices().boxed().collect(Collectors.toList());
             newMembers = new ArrayList<>();
             boolean inserted = false;
@@ -784,6 +779,6 @@
     @Override
     public void reverse() {
-        List<Integer> selectedIndices = ArrayUtils.toList(getSelectedIndices());
-        List<Integer> selectedIndicesReversed = ArrayUtils.toList(getSelectedIndices());
+        List<Integer> selectedIndices = selectedIndices().boxed().collect(Collectors.toList());
+        List<Integer> selectedIndicesReversed = selectedIndices().boxed().collect(Collectors.toList());
 
         if (selectedIndices.size() <= 1) {
Index: trunk/src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java	(revision 17772)
+++ trunk/src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java	(revision 17773)
@@ -2,5 +2,4 @@
 package org.openstreetmap.josm.gui.history;
 
-import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Objects;
@@ -61,5 +60,4 @@
         preventRecursion = true;
         ListSelectionModel referenceModel = (ListSelectionModel) e.getSource();
-        int[] selectedIndices = TableHelper.getSelectedIndices(referenceModel);
         for (ListSelectionModel model : participants) {
             if (model == referenceModel) {
@@ -67,5 +65,5 @@
             }
             TableHelper.setSelectedIndices(model,
-                    Arrays.stream(selectedIndices).flatMap(i -> selectionIndexMapper.apply(i, referenceModel)));
+                    TableHelper.selectedIndices(referenceModel).flatMap(i -> selectionIndexMapper.apply(i, referenceModel)));
         }
         preventRecursion = false;
Index: trunk/src/org/openstreetmap/josm/gui/util/ReorderableTableModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/ReorderableTableModel.java	(revision 17772)
+++ trunk/src/org/openstreetmap/josm/gui/util/ReorderableTableModel.java	(revision 17773)
@@ -3,4 +3,5 @@
 
 import java.util.Arrays;
+import java.util.stream.IntStream;
 
 import javax.swing.JList;
@@ -38,7 +39,17 @@
      * Returns an array of all of the selected indices in the selection model, in increasing order.
      * @return an array of all of the selected indices in the selection model, in increasing order
+     * @see #selectedIndices()
      */
     default int[] getSelectedIndices() {
         return TableHelper.getSelectedIndices(getSelectionModel());
+    }
+
+    /**
+     * Returns a stream of all of the selected indices in the selection model, in increasing order.
+     * @return a stream of all of the selected indices in the selection model, in increasing order
+     * @since 17773
+     */
+    default IntStream selectedIndices() {
+        return TableHelper.selectedIndices(getSelectionModel());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java	(revision 17772)
+++ trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java	(revision 17773)
@@ -123,5 +123,6 @@
      * Unfortunately this method is not available in OpenJDK before version 11, see
      * https://bugs.openjdk.java.net/browse/JDK-8199395
-     * Code taken from OpenJDK 11. To be removed when we switch to Java 11 or later.
+     *
+     * To be removed when we switch to Java 11 or later.
      *
      * @param selectionModel list selection model.
@@ -130,23 +131,25 @@
      *         or an empty array if nothing is selected
      * @since 15226
+     * @see #selectedIndices(ListSelectionModel)
      */
     public static int[] getSelectedIndices(ListSelectionModel selectionModel) {
-        int iMin = selectionModel.getMinSelectionIndex();
-        int iMax = selectionModel.getMaxSelectionIndex();
+        return selectedIndices(selectionModel).toArray();
+    }
 
-        if (iMin < 0 || iMax < 0) {
-            return new int[0];
+    /**
+     * Returns a stream of all of the selected indices in the selection model, in increasing order.
+     *
+     * @param selectionModel list selection model.
+     *
+     * @return all of the selected indices, in increasing order,
+     *         or an empty stream if nothing is selected
+     * @since 17773
+     */
+    public static IntStream selectedIndices(ListSelectionModel selectionModel) {
+        if (selectionModel.isSelectionEmpty()) {
+            return IntStream.empty();
         }
-
-        int[] rvTmp = new int[1 + iMax - iMin];
-        int n = 0;
-        for (int i = iMin; i <= iMax; i++) {
-            if (selectionModel.isSelectedIndex(i)) {
-                rvTmp[n++] = i;
-            }
-        }
-        int[] rv = new int[n];
-        System.arraycopy(rvTmp, 0, rv, 0, n);
-        return rv;
+        return IntStream.rangeClosed(selectionModel.getMinSelectionIndex(), selectionModel.getMaxSelectionIndex())
+                .filter(selectionModel::isSelectedIndex);
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/ArrayUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ArrayUtils.java	(revision 17772)
+++ 	(revision )
@@ -1,47 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.tools;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * Utility methods for arrays.
- * @since 15226
- */
-public final class ArrayUtils {
-
-    /**
-     * Utility class
-     */
-    private ArrayUtils() {
-        // Hide default constructor for utility classes
-    }
-
-    /**
-     * Converts an array of int to a list of Integer.
-     * @param array array of int
-     * @return list of Integer
-     */
-    public static List<Integer> toList(int[] array) {
-        return Arrays.stream(array).boxed().collect(Collectors.toList());
-    }
-
-    /**
-     * Converts an array of long to a list of Long.
-     * @param array array of long
-     * @return list of Long
-     */
-    public static List<Long> toList(long[] array) {
-        return Arrays.stream(array).boxed().collect(Collectors.toList());
-    }
-
-    /**
-     * Converts an array of double to a list of Double.
-     * @param array array of double
-     * @return list of Double
-     */
-    public static List<Double> toList(double[] array) {
-        return Arrays.stream(array).boxed().collect(Collectors.toList());
-    }
-}
