Index: src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 17373)
+++ src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(date 1606592399159)
@@ -1123,8 +1123,8 @@
             OsmPrimitive nxt = first;
 
             if (cyclePrims && shift) {
-                for (Iterator<OsmPrimitive> i = cycleList.iterator(); i.hasNext();) {
-                    nxt = i.next();
+                for (OsmPrimitive osmPrimitive : cycleList) {
+                    nxt = osmPrimitive;
                     if (!nxt.isSelected()) {
                         break; // take first primitive in cycleList not in sel
                     }
Index: src/org/openstreetmap/josm/actions/JoinAreasAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 17373)
+++ src/org/openstreetmap/josm/actions/JoinAreasAction.java	(date 1606592399167)
@@ -707,8 +707,7 @@
 
         //  see #9599
         if (discardedWays.stream().anyMatch(w -> !w.isNew())) {
-            for (int i = 0; i < boundaries.size(); i++) {
-                AssembledPolygon ring = boundaries.get(i);
+            for (AssembledPolygon ring : boundaries) {
                 for (int k = 0; k < ring.ways.size(); k++) {
                     WayInPolygon ringWay = ring.ways.get(k);
                     Way older = keepOlder(ringWay.way, oldestWayMap, discardedWays);
Index: src/org/openstreetmap/josm/data/cache/HostLimitQueue.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/cache/HostLimitQueue.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/cache/HostLimitQueue.java	(date 1606592399171)
@@ -3,7 +3,6 @@
 
 import java.io.IOException;
 import java.net.URL;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.LinkedBlockingDeque;
@@ -52,8 +51,7 @@
     }
 
     private JCSCachedTileLoaderJob<?, ?> findJob() {
-        for (Iterator<Runnable> it = iterator(); it.hasNext();) {
-            Runnable r = it.next();
+        for (Runnable r : this) {
             if (r instanceof JCSCachedTileLoaderJob) {
                 JCSCachedTileLoaderJob<?, ?> job = (JCSCachedTileLoaderJob<?, ?>) r;
                 if (tryAcquireSemaphore(job)) {
Index: src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(date 1606592399171)
@@ -104,8 +104,8 @@
         }
         boolean isFirst = true;
 
-        for (int t = 0; t < trks.size(); t++) {
-            List<List<WayPoint>> segs = trks.get(t);
+        // TODO: refactor this to be more readable
+        for (List<List<WayPoint>> segs : trks) {
             for (int s = 0; s < segs.size(); s++) {
                 List<WayPoint> wps = segs.get(s);
                 for (int i = 0; i < wps.size(); i++) {
Index: src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java	(date 1606592479554)
@@ -262,8 +262,8 @@
      */
     private static NTV2SubGrid getSubGrid(NTV2SubGrid[] topLevelSubGrid, double lon, double lat) {
         NTV2SubGrid sub = null;
-        for (int i = 0; i < topLevelSubGrid.length; i++) {
-            sub = topLevelSubGrid[i].getSubGridForCoord(lon, lat);
+        for (NTV2SubGrid subGrid : topLevelSubGrid) {
+            sub = subGrid.getSubGridForCoord(lon, lat);
             if (sub != null) {
                 break;
             }
@@ -273,30 +273,18 @@
 
     @Override
     public String toString() {
-        return new StringBuilder(256)
-            .append("Headers  : ")
-            .append(overviewHeaderCount)
-            .append("\nSub Hdrs : ")
-            .append(subGridHeaderCount)
-            .append("\nSub Grids: ")
-            .append(subGridCount)
-            .append("\nType     : ")
-            .append(shiftType)
-            .append("\nVersion  : ")
-            .append(version)
-            .append("\nFr Ellpsd: ")
-            .append(fromEllipsoid)
-            .append("\nTo Ellpsd: ")
-            .append(toEllipsoid)
-            .append("\nFr Maj Ax: ")
-            .append(fromSemiMajorAxis)
-            .append("\nFr Min Ax: ")
-            .append(fromSemiMinorAxis)
-            .append("\nTo Maj Ax: ")
-            .append(toSemiMajorAxis)
-            .append("\nTo Min Ax: ")
-            .append(toSemiMinorAxis)
-            .toString();
+        char endl = '\n';
+        return "Headers  : " + overviewHeaderCount + endl +
+                "Sub Hdrs : " + subGridHeaderCount + endl +
+                "Sub Grids: " + subGridCount + endl +
+                "Type     : " + shiftType + endl +
+                "Version  : " + version + endl +
+                "Fr Ellpsd: " + fromEllipsoid + endl +
+                "To Ellpsd: " + toEllipsoid + endl +
+                "Fr Maj Ax: " + fromSemiMajorAxis + endl +
+                "Fr Min Ax: " + fromSemiMinorAxis + endl +
+                "To Maj Ax: " + toSemiMajorAxis + endl +
+                "To Min Ax: " + toSemiMinorAxis;
     }
 
     /**
Index: src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java	(date 1606592399179)
@@ -275,8 +275,8 @@
                 schemes = DEFAULT_SCHEMES;
             }
             allowedSchemes = new HashSet<>(schemes.length);
-            for (int i = 0; i < schemes.length; i++) {
-                allowedSchemes.add(schemes[i].toLowerCase(Locale.ENGLISH));
+            for (String scheme : schemes) {
+                allowedSchemes.add(scheme.toLowerCase(Locale.ENGLISH));
             }
         }
 
Index: src/org/openstreetmap/josm/data/validation/tests/ConnectivityRelations.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/validation/tests/ConnectivityRelations.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/validation/tests/ConnectivityRelations.java	(date 1606592399183)
@@ -82,8 +82,8 @@
 
         final Map<Integer, Map<Integer, Boolean>> result = new HashMap<>();
         String[] lanes = joined.split("\\|", -1);
-        for (int i = 0; i < lanes.length; i++) {
-            String[] lane = lanes[i].split(":", -1);
+        for (final String s : lanes) {
+            String[] lane = s.split(":", -1);
             int laneNumber;
             //Ignore connections from bw, since we cannot derive a lane number from bw
             if (!"bw".equals(lane[0])) {
@@ -93,8 +93,8 @@
             }
             Map<Integer, Boolean> connections = new HashMap<>();
             String[] toLanes = TO_LANE_PATTERN.split(lane[1], -1);
-            for (int j = 0; j < toLanes.length; j++) {
-                String toLane = toLanes[j].trim();
+            for (final String value : toLanes) {
+                String toLane = value.trim();
                 try {
                     if (OPTIONAL_LANE_PATTERN.matcher(toLane).matches()) {
                         toLane = toLane.replace("(", "").replace(")", "").trim();
Index: src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(date 1606592399191)
@@ -155,7 +155,7 @@
     /**
      * Returns the list of "duplicate nodes" errors for the given selection of node and parent test
      * @param parentTest The parent test of returned errors
-     * @param nodes The nodes selction to look into
+     * @param nodes The nodes selection to look into
      * @return the list of "duplicate nodes" errors
      */
     public List<TestError> buildTestErrors(Test parentTest, List<Node> nodes) {
@@ -186,8 +186,7 @@
                                 boolean typed = false;
                                 Way w = (Way) sp;
                                 Map<String, String> keys = w.getKeys();
-                                for (Iterator<Entry<String, Boolean>> itt = typeMap.entrySet().iterator(); itt.hasNext();) {
-                                    Entry<String, Boolean> e = itt.next();
+                                for (Entry<String, Boolean> e : typeMap.entrySet()) {
                                     if (keys.containsKey(e.getKey())) {
                                         e.setValue(Boolean.TRUE);
                                         typed = true;
Index: src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java	(revision 17373)
+++ src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java	(date 1606592399191)
@@ -219,14 +219,14 @@
             // build regular expression for other words (for fast match)
             StringBuilder expression = new StringBuilder();
             int maxLength = 0;
-            for (int i = 0; i < words.length; i++) {
-                if (words[i].length() > maxLength) {
-                    maxLength = words[i].length();
+            for (String word : words) {
+                if (word.length() > maxLength) {
+                    maxLength = word.length();
                 }
                 if (expression.length() > 0) {
                     expression.append('|');
                 }
-                expression.append(Pattern.quote(words[i]));
+                expression.append(Pattern.quote(word));
             }
             this.regExpr = Pattern.compile(expression.toString(), CASE_INSENSITIVE + UNICODE_CASE);
         }
@@ -242,8 +242,7 @@
 
             // which word matches?
             String part = "";
-            for (int i = 0; i < words.length; i++) {
-                String word = words[i];
+            for (String word : words) {
                 if (start + word.length() <= name.length()) {
                     part = name.substring(start, start + word.length());
                 }
Index: src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 17373)
+++ src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(date 1606592399195)
@@ -276,8 +276,8 @@
     private void buildUndoTree() {
         List<Command> undoCommands = UndoRedoHandler.getInstance().getUndoCommands();
         undoRoot = new DefaultMutableTreeNode();
-        for (int i = 0; i < undoCommands.size(); ++i) {
-            undoRoot.add(getNodeForCommand(undoCommands.get(i)));
+        for (Command undoCommand : undoCommands) {
+            undoRoot.add(getNodeForCommand(undoCommand));
         }
         undoTreeModel.setRoot(undoRoot);
     }
@@ -285,8 +285,8 @@
     private void buildRedoTree() {
         List<Command> redoCommands = UndoRedoHandler.getInstance().getRedoCommands();
         redoRoot = new DefaultMutableTreeNode();
-        for (int i = 0; i < redoCommands.size(); ++i) {
-            redoRoot.add(getNodeForCommand(redoCommands.get(i)));
+        for (Command redoCommand : redoCommands) {
+            redoRoot.add(getNodeForCommand(redoCommand));
         }
         redoTreeModel.setRoot(redoRoot);
     }
@@ -340,8 +340,8 @@
         CommandListMutableTreeNode node = new CommandListMutableTreeNode(c);
         if (c.getChildren() != null) {
             List<PseudoCommand> children = new ArrayList<>(c.getChildren());
-            for (int i = 0; i < children.size(); ++i) {
-                node.add(getNodeForCommand(children.get(i)));
+            for (PseudoCommand child : children) {
+                node.add(getNodeForCommand(child));
             }
         }
         return node;
Index: src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 17373)
+++ src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(date 1606592399195)
@@ -193,8 +193,7 @@
          * Determine the panel geometry
          */
         if (action == Action.RESTORE_SAVED || action == Action.ELEMENT_SHRINKS) {
-            for (int i = 0; i < n; ++i) {
-                final ToggleDialog dlg = allDialogs.get(i);
+            for (final ToggleDialog dlg : allDialogs) {
                 if (dlg.isDialogInDefaultView()) {
                     final int ph = action == Action.RESTORE_SAVED ? dlg.getLastHeight() : dlg.getPreferredHeight();
                     final int ah = dlg.getSize().height;
@@ -250,8 +249,7 @@
              */
             int dm = 0;        // additional space needed by the small dialogs
             int dp = 0;        // available space from the large dialogs
-            for (int i = 0; i < n; ++i) {
-                final ToggleDialog dlg = allDialogs.get(i);
+            for (final ToggleDialog dlg : allDialogs) {
                 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) {
                     final int ha = dlg.getSize().height;                              // current
                     final int h0 = ha * r / sumA;                                     // proportional shrinking
@@ -265,8 +263,7 @@
                 }
             }
             /** adjust, without changing the sum */
-            for (int i = 0; i < n; ++i) {
-                final ToggleDialog dlg = allDialogs.get(i);
+            for (final ToggleDialog dlg : allDialogs) {
                 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) {
                     final int ha = dlg.getHeight();
                     final int h0 = ha * r / sumA;
@@ -275,7 +272,7 @@
                         int hn = Math.min(ha, he);
                         dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, hn));
                     } else {
-                        int d = dp == 0 ? 0 : ((h0-he) * dm / dp);
+                        int d = dp == 0 ? 0 : ((h0 - he) * dm / dp);
                         dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, h0 - d));
                     }
                 }
Index: src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/CompletelyInsideAreaStrategy.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/CompletelyInsideAreaStrategy.java	(revision 17373)
+++ src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/CompletelyInsideAreaStrategy.java	(date 1606592399203)
@@ -39,7 +39,7 @@
         // will have to do.                                    ++
         // Centroids are not optimal either, just imagine a U-shaped house.
 
-        Rectangle pb = path.getBounds();
+        final Rectangle pb = path.getBounds();
 
         // quick check to see if label box is smaller than primitive box
         if (pb.width < nb.getWidth() || pb.height < nb.getHeight()) {
@@ -55,7 +55,7 @@
         final int nbw = (int) nb.getWidth();
         final int nbh = (int) nb.getHeight();
 
-        Rectangle centeredNBounds = new Rectangle(x2, y2, nbw, nbh);
+        final Rectangle centeredNBounds = new Rectangle(x2, y2, nbw, nbh);
 
         // slower check to see if label is displayed inside primitive shape
         if (path.contains(centeredNBounds)) {
@@ -84,10 +84,9 @@
         };
         // Dumb algorithm to find a better placement. We could surely find a smarter one but it should
         // solve most of building issues with only few calculations (8 at most)
-        for (int i = 0; i < candidates.length; i++) {
-            centeredNBounds = candidates[i];
-            if (path.contains(centeredNBounds)) {
-                return centerOf(path.getMapViewState(), centeredNBounds);
+        for (Rectangle candidate : candidates) {
+            if (path.contains(candidate)) {
+                return centerOf(path.getMapViewState(), candidate);
             }
         }
 
Index: src/org/openstreetmap/josm/tools/ListenerList.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/tools/ListenerList.java	(revision 17373)
+++ src/org/openstreetmap/josm/tools/ListenerList.java	(date 1606592399207)
@@ -4,7 +4,6 @@
 import java.lang.ref.WeakReference;
 import java.text.MessageFormat;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Objects;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.stream.Stream;
@@ -155,8 +154,7 @@
         for (T l : listeners) {
             eventFirerer.fire(l);
         }
-        for (Iterator<WeakListener<T>> iterator = weakListeners.iterator(); iterator.hasNext();) {
-            WeakListener<T> weakLink = iterator.next();
+        for (WeakListener<T> weakLink : weakListeners) {
             T l = weakLink.listener.get();
             if (l != null) {
                 // cleanup during add() should be enough to not cause memory leaks
Index: src/org/openstreetmap/josm/tools/Utils.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/tools/Utils.java	(revision 17373)
+++ src/org/openstreetmap/josm/tools/Utils.java	(date 1606592399211)
@@ -1509,9 +1509,9 @@
             dirStrings[i] = new DirectionString(dir, substr);
         }
         Bidi.reorderVisually(levels, 0, dirStrings, 0, levels.length);
-        for (int i = 0; i < dirStrings.length; ++i) {
-            char[] chars = dirStrings[i].str.toCharArray();
-            gvs.add(font.layoutGlyphVector(frc, chars, 0, chars.length, dirStrings[i].direction));
+        for (DirectionString dirString : dirStrings) {
+            char[] chars = dirString.str.toCharArray();
+            gvs.add(font.layoutGlyphVector(frc, chars, 0, chars.length, dirString.direction));
         }
         return gvs;
     }
Index: test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java	(revision 17373)
+++ test/unit/org/openstreetmap/josm/data/validation/routines/DomainValidatorTestIT.java	(date 1606592399215)
@@ -347,9 +347,9 @@
 
     private static boolean isInIanaList(String name, String[] array, Set<String> ianaTlds) {
         boolean ok = true;
-        for (int i = 0; i < array.length; i++) {
-            if (!ianaTlds.contains(array[i])) {
-                Logging.error(name + " contains unexpected value: " + array[i]);
+        for (String element : array) {
+            if (!ianaTlds.contains(element)) {
+                Logging.error(name + " contains unexpected value: " + element);
                 ok = false;
             }
         }
Index: test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java	(revision 17373)
+++ test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java	(date 1606592399219)
@@ -492,12 +492,12 @@
     @Disabled("This test fails so disable it for 1.1.4 release. The real solution is to fix the email parsing")
     @Test
     void testEmailFromPerl() {
-        for (int index = 0; index < testEmailFromPerl.length; index++) {
-            String item = testEmailFromPerl[index].item;
-            if (testEmailFromPerl[index].valid) {
-                assertTrue("Should be OK: "+item, validator.isValid(item));
+        for (ResultPair resultPair : testEmailFromPerl) {
+            String item = resultPair.item;
+            if (resultPair.valid) {
+                assertTrue("Should be OK: " + item, validator.isValid(item));
             } else {
-                assertFalse("Should fail: "+item, validator.isValid(item));
+                assertFalse("Should fail: " + item, validator.isValid(item));
             }
         }
     }
Index: test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java	(revision 17373)
+++ test/unit/org/openstreetmap/josm/data/validation/routines/UrlValidatorTest.java	(date 1606592546790)
@@ -30,110 +30,109 @@
  */
 class UrlValidatorTest {
 
-   private static final boolean printStatus = false;
-   private static final boolean printIndex = false; //print index that indicates current scheme,host,port,path, query test were using.
+    private static final boolean printStatus = false;
+    private static final boolean printIndex = false; //print index that indicates current scheme,host,port,path, query test were using.
 
-   /**
-    * Setup
-    */
-   @BeforeEach
-   public void setUp() {
-      for (int index = 0; index < testPartsIndex.length - 1; index++) {
-         testPartsIndex[index] = 0;
-      }
-   }
+    /**
+     * Setup
+     */
+    @BeforeEach
+    public void setUp() {
+        for (int index = 0; index < testPartsIndex.length - 1; index++) {
+            testPartsIndex[index] = 0;
+        }
+    }
 
-   /**
-    * Test is valid
-    */
-   @Test
-   public void testIsValid() {
+    /**
+     * Test is valid
+     */
+    @Test
+    public void testIsValid() {
         testIsValid(testUrlParts, UrlValidator.ALLOW_ALL_SCHEMES);
         setUp();
         long options =
-            UrlValidator.ALLOW_2_SLASHES
-                + UrlValidator.ALLOW_ALL_SCHEMES
-                + UrlValidator.NO_FRAGMENTS;
+                UrlValidator.ALLOW_2_SLASHES
+                        + UrlValidator.ALLOW_ALL_SCHEMES
+                        + UrlValidator.NO_FRAGMENTS;
 
         testIsValid(testUrlPartsOptions, options);
-   }
+    }
 
-   /**
-    * Test is valid scheme
-    */
-   @Test
-   public void testIsValidScheme() {
-      if (printStatus) {
-         System.out.print("\n testIsValidScheme() ");
-      }
-      //UrlValidator urlVal = new UrlValidator(schemes,false,false,false);
-      UrlValidator urlVal = new UrlValidator(schemes, 0);
-      for (int sIndex = 0; sIndex < testScheme.length; sIndex++) {
-         ResultPair testPair = testScheme[sIndex];
-         boolean result = urlVal.isValidScheme(testPair.item);
-         assertEquals(testPair.item, testPair.valid, result);
-         if (printStatus) {
-            if (result == testPair.valid) {
-               System.out.print('.');
-            } else {
-               System.out.print('X');
-            }
-         }
-      }
-      if (printStatus) {
-         System.out.println();
-      }
-   }
+    /**
+     * Test is valid scheme
+     */
+    @Test
+    public void testIsValidScheme() {
+        if (printStatus) {
+            System.out.print("\n testIsValidScheme() ");
+        }
+        //UrlValidator urlVal = new UrlValidator(schemes,false,false,false);
+        UrlValidator urlVal = new UrlValidator(schemes, 0);
+        for (ResultPair testPair : testScheme) {
+            boolean result = urlVal.isValidScheme(testPair.item);
+            assertEquals(testPair.item, testPair.valid, result);
+            if (printStatus) {
+                if (result == testPair.valid) {
+                    System.out.print('.');
+                } else {
+                    System.out.print('X');
+                }
+            }
+        }
+        if (printStatus) {
+            System.out.println();
+        }
+    }
 
-   /**
-    * Create set of tests by taking the testUrlXXX arrays and
-    * running through all possible permutations of their combinations.
-    *
-    * @param testObjects Used to create a url.
-    * @param options options
-    */
-   private void testIsValid(Object[] testObjects, long options) {
-      UrlValidator urlVal = new UrlValidator(null, null, options);
-      assertTrue(urlVal.isValid("http://www.google.com"));
-      assertTrue(urlVal.isValid("http://www.google.com/"));
-      int statusPerLine = 60;
-      int printed = 0;
-      if (printIndex) {
-         statusPerLine = 6;
-      }
-      do {
-          StringBuilder testBuffer = new StringBuilder();
-         boolean expected = true;
-         for (int testPartsIndexIndex = 0; testPartsIndexIndex < testPartsIndex.length; ++testPartsIndexIndex) {
-            int index = testPartsIndex[testPartsIndexIndex];
-            ResultPair[] part = (ResultPair[]) testObjects[testPartsIndexIndex];
-            testBuffer.append(part[index].item);
-            expected &= part[index].valid;
-         }
-         String url = testBuffer.toString();
-         boolean result = urlVal.isValid(url);
-         assertEquals(url, expected, result);
-         if (printStatus) {
-            if (printIndex) {
-               System.out.print(testPartsIndextoString());
-            } else {
-               if (result == expected) {
-                  System.out.print('.');
-               } else {
-                  System.out.print('X');
-               }
-            }
-            printed++;
-            if (printed == statusPerLine) {
-               System.out.println();
-               printed = 0;
-            }
-         }
-      } while (incrementTestPartsIndex(testPartsIndex, testObjects));
-      if (printStatus) {
-         System.out.println();
-      }
-   }
+    /**
+     * Create set of tests by taking the testUrlXXX arrays and
+     * running through all possible permutations of their combinations.
+     *
+     * @param testObjects Used to create a url.
+     * @param options     options
+     */
+    private void testIsValid(Object[] testObjects, long options) {
+        UrlValidator urlVal = new UrlValidator(null, null, options);
+        assertTrue(urlVal.isValid("http://www.google.com"));
+        assertTrue(urlVal.isValid("http://www.google.com/"));
+        int statusPerLine = 60;
+        int printed = 0;
+        if (printIndex) {
+            statusPerLine = 6;
+        }
+        do {
+            StringBuilder testBuffer = new StringBuilder();
+            boolean expected = true;
+            for (int testPartsIndexIndex = 0; testPartsIndexIndex < testPartsIndex.length; ++testPartsIndexIndex) {
+                int index = testPartsIndex[testPartsIndexIndex];
+                ResultPair[] part = (ResultPair[]) testObjects[testPartsIndexIndex];
+                testBuffer.append(part[index].item);
+                expected &= part[index].valid;
+            }
+            String url = testBuffer.toString();
+            boolean result = urlVal.isValid(url);
+            assertEquals(url, expected, result);
+            if (printStatus) {
+                if (printIndex) {
+                    System.out.print(testPartsIndextoString());
+                } else {
+                    if (result == expected) {
+                        System.out.print('.');
+                    } else {
+                        System.out.print('X');
+                    }
+                }
+                printed++;
+                if (printed == statusPerLine) {
+                    System.out.println();
+                    printed = 0;
+                }
+            }
+        } while (incrementTestPartsIndex(testPartsIndex, testObjects));
+        if (printStatus) {
+            System.out.println();
+        }
+    }
 
     /**
      * Non-regression test for VALIDATOR-202
@@ -143,7 +142,7 @@
         String[] schemes = {"http", "https"};
         UrlValidator urlValidator = new UrlValidator(schemes, UrlValidator.NO_FRAGMENTS);
         assertTrue(urlValidator.isValid(
-          "http://l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.org"));
+                "http://l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.org"));
     }
 
     /**
@@ -163,7 +162,7 @@
     void testValidator218() {
         UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_2_SLASHES);
         assertTrue("parentheses should be valid in URLs",
-               validator.isValid("http://somewhere.com/pathxyz/file(1).html"));
+                validator.isValid("http://somewhere.com/pathxyz/file(1).html"));
     }
 
     /**
@@ -190,7 +189,7 @@
      */
     @Test
     void testValidator248() {
-        RegexValidator regex = new RegexValidator(new String[] {"localhost", ".*\\.my-testing"});
+        RegexValidator regex = new RegexValidator("localhost", ".*\\.my-testing");
         UrlValidator validator = new UrlValidator(regex, 0);
 
         assertTrue("localhost URL should validate",
@@ -210,13 +209,13 @@
         validator = new UrlValidator(UrlValidator.ALLOW_LOCAL_URLS);
 
         assertTrue("localhost URL should validate",
-              validator.isValid("http://localhost/test/index.html"));
+                validator.isValid("http://localhost/test/index.html"));
 
         assertTrue("machinename URL should validate",
-              validator.isValid("http://machinename/test/index.html"));
+                validator.isValid("http://machinename/test/index.html"));
 
         assertTrue("www.apache.org should still validate",
-              validator.isValid("http://www.apache.org/test/index.html"));
+                validator.isValid("http://www.apache.org/test/index.html"));
     }
 
     /**
@@ -266,52 +265,52 @@
         UrlValidator validator = new UrlValidator();
 
         assertTrue("http://apache.org/ should be allowed by default",
-                 validator.isValid("http://www.apache.org/test/index.html"));
+                validator.isValid("http://www.apache.org/test/index.html"));
 
         assertFalse("file:///c:/ shouldn't be allowed by default",
-                 validator.isValid("file:///C:/some.file"));
+                validator.isValid("file:///C:/some.file"));
 
         assertFalse("file:///c:\\ shouldn't be allowed by default",
-              validator.isValid("file:///C:\\some.file"));
+                validator.isValid("file:///C:\\some.file"));
 
         assertFalse("file:///etc/ shouldn't be allowed by default",
-              validator.isValid("file:///etc/hosts"));
+                validator.isValid("file:///etc/hosts"));
 
         assertFalse("file://localhost/etc/ shouldn't be allowed by default",
-              validator.isValid("file://localhost/etc/hosts"));
+                validator.isValid("file://localhost/etc/hosts"));
 
         assertFalse("file://localhost/c:/ shouldn't be allowed by default",
-              validator.isValid("file://localhost/c:/some.file"));
+                validator.isValid("file://localhost/c:/some.file"));
 
         // Turn it on, and check
         // Note - we need to enable local urls when working with file:
-        validator = new UrlValidator(new String[] {"http", "file"}, UrlValidator.ALLOW_LOCAL_URLS);
+        validator = new UrlValidator(new String[]{"http", "file"}, UrlValidator.ALLOW_LOCAL_URLS);
 
         assertTrue("http://apache.org/ should be allowed by default",
-                 validator.isValid("http://www.apache.org/test/index.html"));
+                validator.isValid("http://www.apache.org/test/index.html"));
 
         assertTrue("file:///c:/ should now be allowed",
-                 validator.isValid("file:///C:/some.file"));
+                validator.isValid("file:///C:/some.file"));
 
         // Currently, we don't support the c:\ form
         assertFalse("file:///c:\\ shouldn't be allowed",
-              validator.isValid("file:///C:\\some.file"));
+                validator.isValid("file:///C:\\some.file"));
 
         assertTrue("file:///etc/ should now be allowed",
-              validator.isValid("file:///etc/hosts"));
+                validator.isValid("file:///etc/hosts"));
 
         assertTrue("file://localhost/etc/ should now be allowed",
-              validator.isValid("file://localhost/etc/hosts"));
+                validator.isValid("file://localhost/etc/hosts"));
 
         assertTrue("file://localhost/c:/ should now be allowed",
-              validator.isValid("file://localhost/c:/some.file"));
+                validator.isValid("file://localhost/c:/some.file"));
 
         // These are never valid
         assertFalse("file://c:/ shouldn't ever be allowed, needs file:///c:/",
-              validator.isValid("file://C:/some.file"));
+                validator.isValid("file://C:/some.file"));
 
         assertFalse("file://c:\\ shouldn't ever be allowed, needs file:///c:/",
-              validator.isValid("file://C:\\some.file"));
+                validator.isValid("file://C:\\some.file"));
     }
 
     /**
@@ -323,7 +322,7 @@
         assertTrue(urlValidator.isValid("http://sample.ondemand.com/"));
         assertTrue(urlValidator.isValid("hTtP://sample.ondemand.CoM/"));
         assertTrue(urlValidator.isValid("httpS://SAMPLE.ONEMAND.COM/"));
-        urlValidator = new UrlValidator(new String[] {"HTTP", "HTTPS"});
+        urlValidator = new UrlValidator("HTTP", "HTTPS");
         assertTrue(urlValidator.isValid("http://sample.ondemand.com/"));
         assertTrue(urlValidator.isValid("hTtP://sample.ondemand.CoM/"));
         assertTrue(urlValidator.isValid("httpS://SAMPLE.ONEMAND.COM/"));
@@ -366,45 +365,45 @@
     }
 
     static boolean incrementTestPartsIndex(int[] testPartsIndex, Object[] testParts) {
-      boolean carry = true;  //add 1 to lowest order part.
-      boolean maxIndex = true;
-      for (int testPartsIndexIndex = testPartsIndex.length - 1; testPartsIndexIndex >= 0; --testPartsIndexIndex) {
-         int index = testPartsIndex[testPartsIndexIndex];
-         ResultPair[] part = (ResultPair[]) testParts[testPartsIndexIndex];
-         if (carry) {
-            if (index < part.length - 1) {
-               index++;
-               testPartsIndex[testPartsIndexIndex] = index;
-               carry = false;
-            } else {
-               testPartsIndex[testPartsIndexIndex] = 0;
-               carry = true;
-            }
-         }
-         maxIndex &= (index == (part.length - 1));
-      }
+        boolean carry = true;  //add 1 to lowest order part.
+        boolean maxIndex = true;
+        for (int testPartsIndexIndex = testPartsIndex.length - 1; testPartsIndexIndex >= 0; --testPartsIndexIndex) {
+            int index = testPartsIndex[testPartsIndexIndex];
+            ResultPair[] part = (ResultPair[]) testParts[testPartsIndexIndex];
+            if (carry) {
+                if (index < part.length - 1) {
+                    index++;
+                    testPartsIndex[testPartsIndexIndex] = index;
+                    carry = false;
+                } else {
+                    testPartsIndex[testPartsIndexIndex] = 0;
+                    carry = true;
+                }
+            }
+            maxIndex &= (index == (part.length - 1));
+        }
 
-      return (!maxIndex);
-   }
+        return (!maxIndex);
+    }
 
-   private String testPartsIndextoString() {
-       StringBuilder carryMsg = new StringBuilder("{");
-       for (int testPartsIndexIndex = 0; testPartsIndexIndex < testPartsIndex.length; ++testPartsIndexIndex) {
-         carryMsg.append(testPartsIndex[testPartsIndexIndex]);
-         if (testPartsIndexIndex < testPartsIndex.length - 1) {
-            carryMsg.append(',');
-         } else {
-            carryMsg.append('}');
-         }
-       }
-       return carryMsg.toString();
-   }
+    private String testPartsIndextoString() {
+        StringBuilder carryMsg = new StringBuilder("{");
+        for (int testPartsIndexIndex = 0; testPartsIndexIndex < testPartsIndex.length; ++testPartsIndexIndex) {
+            carryMsg.append(testPartsIndex[testPartsIndexIndex]);
+            if (testPartsIndexIndex < testPartsIndex.length - 1) {
+                carryMsg.append(',');
+            } else {
+                carryMsg.append('}');
+            }
+        }
+        return carryMsg.toString();
+    }
 
-   /**
-    * Non-regression test for VALIDATOR-290
-    */
-   @Test
-   public void testValidator290() {
+    /**
+     * Non-regression test for VALIDATOR-290
+     */
+    @Test
+    public void testValidator290() {
         UrlValidator validator = new UrlValidator();
         assertTrue(validator.isValid("http://xn--h1acbxfam.idn.icann.org/"));
         // Internationalized country code top-level domains
@@ -441,20 +440,20 @@
         assertTrue(validator.isValid("http://test.xn--mgbaam7a8h")); // United Arab Emirates
     }
 
-   /**
-    * Non-regression test for VALIDATOR-361
-    */
-   @Test
-   public void testValidator361() {
-       UrlValidator validator = new UrlValidator();
-       assertTrue(validator.isValid("http://hello.tokyo/"));
+    /**
+     * Non-regression test for VALIDATOR-361
+     */
+    @Test
+    public void testValidator361() {
+        UrlValidator validator = new UrlValidator();
+        assertTrue(validator.isValid("http://hello.tokyo/"));
     }
 
-   /**
-    * Non-regression test for VALIDATOR-363
-    */
-   @Test
-   public void testValidator363() {
+    /**
+     * Non-regression test for VALIDATOR-363
+     */
+    @Test
+    public void testValidator363() {
         UrlValidator urlValidator = new UrlValidator();
         assertTrue(urlValidator.isValid("http://www.example.org/a/b/hello..world"));
         assertTrue(urlValidator.isValid("http://www.example.org/a/hello..world"));
@@ -474,160 +473,175 @@
         assertTrue(urlValidator.isValid("http://www.example.org/.../.."));
     }
 
-   /**
-    * Non-regression test for VALIDATOR-375
-    */
-   @Test
-   public void testValidator375() {
-       UrlValidator validator = new UrlValidator();
-       String url = "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html";
-       assertTrue("IPv6 address URL should validate: " + url, validator.isValid(url));
-       url = "http://[::1]:80/index.html";
-       assertTrue("IPv6 address URL should validate: " + url, validator.isValid(url));
-       url = "http://FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:80/index.html";
-       assertFalse("IPv6 address without [] should not validate: " + url, validator.isValid(url));
+    /**
+     * Non-regression test for VALIDATOR-375
+     */
+    @Test
+    public void testValidator375() {
+        UrlValidator validator = new UrlValidator();
+        String url = "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html";
+        assertTrue("IPv6 address URL should validate: " + url, validator.isValid(url));
+        url = "http://[::1]:80/index.html";
+        assertTrue("IPv6 address URL should validate: " + url, validator.isValid(url));
+        url = "http://FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:80/index.html";
+        assertFalse("IPv6 address without [] should not validate: " + url, validator.isValid(url));
     }
 
-   /**
-    * Non-regression test for VALIDATOR-353
-    */
-   @Test
-   public void testValidator353() { // userinfo
-       UrlValidator validator = new UrlValidator();
-       assertTrue(validator.isValid("http://www.apache.org:80/path"));
-       assertTrue(validator.isValid("http://user:pass@www.apache.org:80/path"));
-       assertTrue(validator.isValid("http://user:@www.apache.org:80/path"));
-       assertTrue(validator.isValid("http://us%00er:-._~!$&'()*+,;=@www.apache.org:80/path"));
-       assertFalse(validator.isValid("http://:pass@www.apache.org:80/path"));
-       assertFalse(validator.isValid("http://:@www.apache.org:80/path"));
-       assertFalse(validator.isValid("http://user:pa:ss@www.apache.org/path"));
-       assertFalse(validator.isValid("http://user:pa@ss@www.apache.org/path"));
-   }
+    /**
+     * Non-regression test for VALIDATOR-353
+     */
+    @Test
+    public void testValidator353() { // userinfo
+        UrlValidator validator = new UrlValidator();
+        assertTrue(validator.isValid("http://www.apache.org:80/path"));
+        assertTrue(validator.isValid("http://user:pass@www.apache.org:80/path"));
+        assertTrue(validator.isValid("http://user:@www.apache.org:80/path"));
+        assertTrue(validator.isValid("http://us%00er:-._~!$&'()*+,;=@www.apache.org:80/path"));
+        assertFalse(validator.isValid("http://:pass@www.apache.org:80/path"));
+        assertFalse(validator.isValid("http://:@www.apache.org:80/path"));
+        assertFalse(validator.isValid("http://user:pa:ss@www.apache.org/path"));
+        assertFalse(validator.isValid("http://user:pa@ss@www.apache.org/path"));
+    }
 
-   /**
-    * Non-regression test for VALIDATOR-382
-    */
-   @Test
-   public void testValidator382() {
-       UrlValidator validator = new UrlValidator();
-       assertTrue(validator.isValid("ftp://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose"));
-   }
+    /**
+     * Non-regression test for VALIDATOR-382
+     */
+    @Test
+    public void testValidator382() {
+        UrlValidator validator = new UrlValidator();
+        assertTrue(validator.isValid("ftp://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose"));
+    }
 
-   /**
-    * Non-regression test for VALIDATOR-380
-    */
-   @Test
-   public void testValidator380() {
-       UrlValidator validator = new UrlValidator();
-       assertTrue(validator.isValid("http://www.apache.org:80/path"));
-       assertTrue(validator.isValid("http://www.apache.org:8/path"));
-       assertTrue(validator.isValid("http://www.apache.org:/path"));
-   }
+    /**
+     * Non-regression test for VALIDATOR-380
+     */
+    @Test
+    public void testValidator380() {
+        UrlValidator validator = new UrlValidator();
+        assertTrue(validator.isValid("http://www.apache.org:80/path"));
+        assertTrue(validator.isValid("http://www.apache.org:8/path"));
+        assertTrue(validator.isValid("http://www.apache.org:/path"));
+    }
 
-   /**
-    * Unit test of {@link UrlValidator#getValidatorName}.
-    */
-   @Test
-   public void testValidatorName() {
-       assertEquals("URL validator", UrlValidator.getInstance().getValidatorName());
-   }
+    /**
+     * Unit test of {@link UrlValidator#getValidatorName}.
+     */
+    @Test
+    public void testValidatorName() {
+        assertEquals("URL validator", UrlValidator.getInstance().getValidatorName());
+    }
 
-   //-------------------- Test data for creating a composite URL
-   /**
-    * The data given below approximates the 4 parts of a URL
-    * {@code <scheme>://<authority><path>?<query>} except that the port number
-    * is broken out of authority to increase the number of permutations.
-    * A complete URL is composed of a scheme+authority+port+path+query,
-    * all of which must be individually valid for the entire URL to be considered
-    * valid.
-    */
-   ResultPair[] testUrlScheme = {new ResultPair("http://", true),
-                               new ResultPair("ftp://", true),
-                               new ResultPair("h3t://", true),
-                               new ResultPair("3ht://", false),
-                               new ResultPair("http:/", false),
-                               new ResultPair("http:", false),
-                               new ResultPair("http/", false),
-                               new ResultPair("://", false),
-                               new ResultPair("", true)};
+    //-------------------- Test data for creating a composite URL
+    /**
+     * The data given below approximates the 4 parts of a URL
+     * {@code <scheme>://<authority><path>?<query>} except that the port number
+     * is broken out of authority to increase the number of permutations.
+     * A complete URL is composed of a scheme+authority+port+path+query,
+     * all of which must be individually valid for the entire URL to be considered
+     * valid.
+     */
+    ResultPair[] testUrlScheme = {
+            new ResultPair("http://", true),
+            new ResultPair("ftp://", true),
+            new ResultPair("h3t://", true),
+            new ResultPair("3ht://", false),
+            new ResultPair("http:/", false),
+            new ResultPair("http:", false),
+            new ResultPair("http/", false),
+            new ResultPair("://", false),
+            new ResultPair("", true)
+    };
 
-   ResultPair[] testUrlAuthority = {new ResultPair("www.google.com", true),
-                                  new ResultPair("go.com", true),
-                                  new ResultPair("go.au", true),
-                                  new ResultPair("0.0.0.0", true),
-                                  new ResultPair("255.255.255.255", true),
-                                  new ResultPair("256.256.256.256", false),
-                                  new ResultPair("255.com", true),
-                                  new ResultPair("1.2.3.4.5", false),
-                                  new ResultPair("1.2.3.4.", false),
-                                  new ResultPair("1.2.3", false),
-                                  new ResultPair(".1.2.3.4", false),
-                                  new ResultPair("go.a", false),
-                                  new ResultPair("go.a1a", false),
-                                  new ResultPair("go.cc", true),
-                                  new ResultPair("go.1aa", false),
-                                  new ResultPair("aaa.", false),
-                                  new ResultPair(".aaa", false),
-                                  new ResultPair("aaa", false),
-                                  new ResultPair("", false)
-   };
-   ResultPair[] testUrlPort = {new ResultPair(":80", true),
-                             new ResultPair(":65535", true),
-                             new ResultPair(":0", true),
-                             new ResultPair("", true),
-                             new ResultPair(":-1", false),
-                             new ResultPair(":65636", true),
-                             new ResultPair(":65a", false)
-   };
-   ResultPair[] testPath = {new ResultPair("/test1", true),
-                          new ResultPair("/t123", true),
-                          new ResultPair("/$23", true),
-                          new ResultPair("/..", false),
-                          new ResultPair("/../", false),
-                          new ResultPair("/test1/", true),
-                          new ResultPair("", true),
-                          new ResultPair("/test1/file", true),
-                          new ResultPair("/..//file", false),
-                          new ResultPair("/test1//file", false)
-   };
-   //Test allow2slash, noFragment
-   ResultPair[] testUrlPathOptions = {new ResultPair("/test1", true),
-                                    new ResultPair("/t123", true),
-                                    new ResultPair("/$23", true),
-                                    new ResultPair("/..", false),
-                                    new ResultPair("/../", false),
-                                    new ResultPair("/test1/", true),
-                                    new ResultPair("/#", false),
-                                    new ResultPair("", true),
-                                    new ResultPair("/test1/file", true),
-                                    new ResultPair("/t123/file", true),
-                                    new ResultPair("/$23/file", true),
-                                    new ResultPair("/../file", false),
-                                    new ResultPair("/..//file", false),
-                                    new ResultPair("/test1//file", true),
-                                    new ResultPair("/#/file", false)
-   };
+    ResultPair[] testUrlAuthority = {
+            new ResultPair("www.google.com", true),
+            new ResultPair("go.com", true),
+            new ResultPair("go.au", true),
+            new ResultPair("0.0.0.0", true),
+            new ResultPair("255.255.255.255", true),
+            new ResultPair("256.256.256.256", false),
+            new ResultPair("255.com", true),
+            new ResultPair("1.2.3.4.5", false),
+            new ResultPair("1.2.3.4.", false),
+            new ResultPair("1.2.3", false),
+            new ResultPair(".1.2.3.4", false),
+            new ResultPair("go.a", false),
+            new ResultPair("go.a1a", false),
+            new ResultPair("go.cc", true),
+            new ResultPair("go.1aa", false),
+            new ResultPair("aaa.", false),
+            new ResultPair(".aaa", false),
+            new ResultPair("aaa", false),
+            new ResultPair("", false)
+    };
+
+    ResultPair[] testUrlPort = {
+            new ResultPair(":80", true),
+            new ResultPair(":65535", true),
+            new ResultPair(":0", true),
+            new ResultPair("", true),
+            new ResultPair(":-1", false),
+            new ResultPair(":65636", true),
+            new ResultPair(":65a", false)
+    };
+
+    ResultPair[] testPath = {
+            new ResultPair("/test1", true),
+            new ResultPair("/t123", true),
+            new ResultPair("/$23", true),
+            new ResultPair("/..", false),
+            new ResultPair("/../", false),
+            new ResultPair("/test1/", true),
+            new ResultPair("", true),
+            new ResultPair("/test1/file", true),
+            new ResultPair("/..//file", false),
+            new ResultPair("/test1//file", false)
+    };
+
+    //Test allow2slash, noFragment
+    ResultPair[] testUrlPathOptions = {
+            new ResultPair("/test1", true),
+            new ResultPair("/t123", true),
+            new ResultPair("/$23", true),
+            new ResultPair("/..", false),
+            new ResultPair("/../", false),
+            new ResultPair("/test1/", true),
+            new ResultPair("/#", false),
+            new ResultPair("", true),
+            new ResultPair("/test1/file", true),
+            new ResultPair("/t123/file", true),
+            new ResultPair("/$23/file", true),
+            new ResultPair("/../file", false),
+            new ResultPair("/..//file", false),
+            new ResultPair("/test1//file", true),
+            new ResultPair("/#/file", false)
+    };
 
-   ResultPair[] testUrlQuery = {new ResultPair("?action=view", true),
-                              new ResultPair("?action=edit&mode=up", true),
-                              new ResultPair("", true)
-   };
+    ResultPair[] testUrlQuery = {
+            new ResultPair("?action=view", true),
+            new ResultPair("?action=edit&mode=up", true),
+            new ResultPair("", true)
+    };
 
-   Object[] testUrlParts = {testUrlScheme, testUrlAuthority, testUrlPort, testPath, testUrlQuery};
-   Object[] testUrlPartsOptions = {testUrlScheme, testUrlAuthority, testUrlPort, testUrlPathOptions, testUrlQuery};
-   int[] testPartsIndex = {0, 0, 0, 0, 0};
+    Object[] testUrlParts = {testUrlScheme, testUrlAuthority, testUrlPort, testPath, testUrlQuery};
+    Object[] testUrlPartsOptions = {testUrlScheme, testUrlAuthority, testUrlPort, testUrlPathOptions, testUrlQuery};
+    int[] testPartsIndex = {0, 0, 0, 0, 0};
 
-   //---------------- Test data for individual url parts ----------------
-   private final String[] schemes = {"http", "gopher", "g0-To+.",
-                                      "not_valid" // TODO this will need to be dropped if the ctor validates schemes
-                                    };
+    //---------------- Test data for individual url parts ----------------
+    private final String[] schemes = {
+            "http",
+            "gopher",
+            "g0-To+.",
+            "not_valid" // TODO this will need to be dropped if the ctor validates schemes
+    };
 
-   ResultPair[] testScheme = {new ResultPair("http", true),
-                            new ResultPair("ftp", false),
-                            new ResultPair("httpd", false),
-                            new ResultPair("gopher", true),
-                            new ResultPair("g0-to+.", true),
-                            new ResultPair("not_valid", false), // underscore not allowed
-                            new ResultPair("HtTp", true),
-                            new ResultPair("telnet", false)};
+    ResultPair[] testScheme = {
+            new ResultPair("http", true),
+            new ResultPair("ftp", false),
+            new ResultPair("httpd", false),
+            new ResultPair("gopher", true),
+            new ResultPair("g0-to+.", true),
+            new ResultPair("not_valid", false), // underscore not allowed
+            new ResultPair("HtTp", true),
+            new ResultPair("telnet", false)
+    };
 }
Index: test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java	(revision 17373)
+++ test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java	(date 1606592399235)
@@ -75,13 +75,13 @@
 
     protected void ensureSelected(DefaultListSelectionModel model, Object... idx) {
         if (idx == null) return;
-        for (int i = 0; i < idx.length; i++) {
-            if (idx[i] instanceof Integer) {
-                int j = (Integer) idx[i];
+        for (Object object : idx) {
+            if (object instanceof Integer) {
+                int j = (Integer) object;
                 assertTrue(model.isSelectedIndex(j), "expected row " + j + " to be selected");
                 break;
             }
-            int[] rows = (int[]) idx[i];
+            int[] rows = (int[]) object;
             if (rows.length != 2) {
                 fail("illegal selection range. Either null or not length 2: " + Arrays.toString(rows));
             }
