Index: trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java	(revision 5782)
+++ trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java	(revision 5783)
@@ -5,5 +5,5 @@
  * A segment consisting of 2 consecutive nodes out of a way.
  */
-public final class WaySegment {
+public final class WaySegment implements Comparable<WaySegment> {
     /**
      * The way.
@@ -50,3 +50,8 @@
         return way.hashCode() ^ lowerIndex;
     }
+
+    @Override
+    public int compareTo(WaySegment o) {
+        return equals(o) ? 0 : toWay().compareTo(o.toWay());
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/TestError.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/TestError.java	(revision 5782)
+++ trunk/src/org/openstreetmap/josm/data/validation/TestError.java	(revision 5783)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.WaySegment;
+import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor;
 
 /**
@@ -19,5 +20,5 @@
  * @author frsantos
  */
-public class TestError {
+public class TestError implements Comparable<TestError> {
     /** is this error on the ignore list */
     private Boolean ignored = false;
@@ -277,3 +278,15 @@
         return highlighted;
     }
+
+    @Override
+    public int compareTo(TestError o) {
+        if (equals(o)) return 0;
+        
+        MultipleNameVisitor v1 = new MultipleNameVisitor();
+        MultipleNameVisitor v2 = new MultipleNameVisitor();
+
+        v1.visit(getPrimitives());
+        v2.visit(o.getPrimitives());
+        return v1.toString().compareToIgnoreCase(v2.toString());
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 5782)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 5783)
@@ -7,8 +7,8 @@
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.openstreetmap.josm.command.ChangeCommand;
@@ -192,5 +192,5 @@
     public void endTest() {
         super.endTest();
-        for(LinkedHashSet<OsmPrimitive> duplicated : relations.values()) {
+        for (Set<OsmPrimitive> duplicated : relations.values()) {
             if (duplicated.size() > 1) {
                 TestError testError = new TestError(this, Severity.ERROR, tr("Duplicated relations"), DUPLICATE_RELATION, duplicated);
@@ -199,5 +199,5 @@
         }
         relations = null;
-        for(LinkedHashSet<OsmPrimitive> duplicated : relations_nokeys.values()) {
+        for (Set<OsmPrimitive> duplicated : relations_nokeys.values()) {
             if (duplicated.size() > 1) {
                 TestError testError = new TestError(this, Severity.WARNING, tr("Relations with same members"), SAME_RELATION, duplicated);
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 5782)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 5783)
@@ -7,7 +7,7 @@
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -56,7 +56,7 @@
     @Override
     public void endTest() {
-        Map<List<Way>, LinkedHashSet<WaySegment>> ways_seen = new HashMap<List<Way>, LinkedHashSet<WaySegment>>(500);
+        Map<List<Way>, Set<WaySegment>> ways_seen = new HashMap<List<Way>, Set<WaySegment>>(500);
 
-        for (LinkedHashSet<WaySegment> duplicated : nodePairs.values()) {
+        for (Set<WaySegment> duplicated : nodePairs.values()) {
             int ways = duplicated.size();
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java	(revision 5782)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java	(revision 5783)
@@ -9,5 +9,4 @@
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -206,5 +205,5 @@
             }
 
-            for (Entry<String, LinkedHashSet<TestError>> msgErrors : severityErrors.entrySet()) {
+            for (Entry<String, Set<TestError>> msgErrors : severityErrors.entrySet()) {
                 // Message node
                 Set<TestError> errs = msgErrors.getValue();
@@ -236,5 +235,5 @@
                 }
 
-                for (Entry<String, LinkedHashSet<TestError>> msgErrors : errorlist.entrySet()) {
+                for (Entry<String, Set<TestError>> msgErrors : errorlist.entrySet()) {
                     // Message node
                     Set<TestError> errs = msgErrors.getValue();
Index: trunk/src/org/openstreetmap/josm/tools/MultiMap.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/MultiMap.java	(revision 5782)
+++ trunk/src/org/openstreetmap/josm/tools/MultiMap.java	(revision 5783)
@@ -5,9 +5,9 @@
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.TreeSet;
 
 /**
@@ -20,12 +20,12 @@
 public class MultiMap<A, B> {
 
-    private final Map<A, LinkedHashSet<B>> map;
+    private final Map<A, Set<B>> map;
 
     public MultiMap() {
-        map = new HashMap<A, LinkedHashSet<B>>();
+        map = new HashMap<A, Set<B>>();
     }
 
     public MultiMap(int capacity) {
-        map = new HashMap<A, LinkedHashSet<B>>(capacity);
+        map = new HashMap<A, Set<B>>(capacity);
     }
 
@@ -36,7 +36,7 @@
      */
     public void put(A key, B value) {
-        LinkedHashSet<B> vals = map.get(key);
+        Set<B> vals = map.get(key);
         if (vals == null) {
-            vals = new LinkedHashSet<B>();
+            vals = new TreeSet<B>();
             map.put(key, vals);
         }
@@ -53,5 +53,5 @@
         if (map.containsKey(key))
             return;
-        map.put(key, new LinkedHashSet<B>());
+        map.put(key, new TreeSet<B>());
     }
 
@@ -62,7 +62,7 @@
      */
     public void putAll(A key, Collection<B> values) {
-        LinkedHashSet<B> vals = map.get(key);
+        Set<B> vals = map.get(key);
         if (vals == null) {
-            vals = new LinkedHashSet<B>(values);
+            vals = new TreeSet<B>(values);
             map.put(key, vals);
         }
@@ -91,7 +91,7 @@
      * Like get, but returns an empty Set if nothing has been mapped to the key.
      */
-    public LinkedHashSet<B> getValues(A key) {
+    public Set<B> getValues(A key) {
         if (!map.containsKey(key))
-            return new LinkedHashSet<B>();
+            return new TreeSet<B>();
         return map.get(key);
     }
@@ -121,5 +121,5 @@
     }
 
-    public Set<Entry<A, LinkedHashSet<B>>> entrySet() {
+    public Set<Entry<A, Set<B>>> entrySet() {
         return map.entrySet();
     }
@@ -135,5 +135,5 @@
      * Returns a collection of all value sets.
      */
-    public Collection<LinkedHashSet<B>> values() {
+    public Collection<Set<B>> values() {
         return map.values();
     }
@@ -155,8 +155,9 @@
      * Removes all mappings for a certain key.
      */
-    public LinkedHashSet<B> remove(A key) {
+    public Set<B> remove(A key) {
         return map.remove(key);
     }
 
+    @Override
     public String toString() {
         List<String> entries = new ArrayList<String>(map.size());
