Index: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcondenseHTMLGUIModel.java
===================================================================
--- trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcondenseHTMLGUIModel.java	(revision 1439)
+++ trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcondenseHTMLGUIModel.java	(revision 1491)
@@ -17,12 +17,17 @@
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashSet;
+import java.util.IdentityHashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.logging.Level;
 
 import de.ugoe.cs.autoquest.CommandHelpers;
+import de.ugoe.cs.autoquest.SequenceInstanceOf;
+import de.ugoe.cs.autoquest.eventcore.Event;
 import de.ugoe.cs.autoquest.eventcore.guimodel.GUIModel;
 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
@@ -125,4 +130,68 @@
         GUIModel model = (GUIModel) dataObject;
         
+        // >>>>>>>>>>>>>>>>>>>>>>>>>>>> Just to test the distance measure
+        
+        System.out.println("checking distance measure correctness");
+        Collection<List<Event>> sequences = null;
+        dataObject = GlobalDataContainer.getInstance().getData(sequencesName);
+        if (dataObject == null) {
+            CommandHelpers.objectNotFoundMessage(sequencesName);
+            return;
+        }
+        if (!SequenceInstanceOf.isCollectionOfSequences(dataObject)) {
+            CommandHelpers.objectNotType(sequencesName, "Collection<List<Event<?>>>");
+            return;
+        }
+
+        sequences = (Collection<List<Event>>) dataObject;
+        
+        Map<IGUIElement, IGUIElement> guiElements = new IdentityHashMap<IGUIElement, IGUIElement>();
+        
+        for (List<Event> sequence : sequences) {
+            for (Event event : sequence) {
+                guiElements.put((IGUIElement) event.getTarget(), (IGUIElement) event.getTarget());
+            }
+        }
+        
+        System.out.println("got " + guiElements.size() + " utilized GUI elements");
+        
+        IGUIElement[] guiElementArray =
+            guiElements.keySet().toArray(new IGUIElement[guiElements.size()]);
+        
+        Arrays.sort(guiElementArray, new Comparator<IGUIElement>() {
+            @Override
+            public int compare(IGUIElement o1, IGUIElement o2) {
+                return o1.getStringIdentifier().compareTo(o2.getStringIdentifier());
+            }
+            
+        });
+        
+        int checkSize = Math.min(guiElements.size() * guiElements.size(), 100000000);
+        double[] expectedDistances = new double[checkSize];
+        int index = 0;
+        
+        OUTER:
+        for (int i = 0; i < guiElementArray.length; i++) {
+            for (int j = 0; j < guiElementArray.length; j++) {
+                if (i == j) {
+                    continue;
+                }
+                
+                if (index == 1703) {
+                    System.out.println("blub");
+                }
+                
+                expectedDistances[index++] = guiElementArray[i].getDistanceTo(guiElementArray[j]);
+                
+                if (index == checkSize) {
+                    break OUTER;
+                }
+            }
+        }
+
+        System.out.println("calculated " + expectedDistances.length + " distances");
+
+        // <<<<<<<<<<<<<<<<<<<<<<<<<<<< Just to test the distance measure
+
         for (IGUIElement root : model.getRootElements()) {
             if (root instanceof HTMLServer) {
@@ -137,4 +206,39 @@
             }
         }
+
+        // >>>>>>>>>>>>>>>>>>>>>>>>>>>> Just to test the distance measure
+        index = 0;
+        
+        System.out.println("checking, if distances are still the same");
+        OUTER:
+        for (int i = 0; i < guiElementArray.length; i++) {
+            for (int j = 0; j < guiElementArray.length; j++) {
+                if (i == j) {
+                    continue;
+                }
+
+                if (index == 1703) {
+                    System.out.println("blub");
+                }
+                
+                double newDistance = guiElementArray[i].getDistanceTo(guiElementArray[j]);
+                if ((expectedDistances[index] != newDistance) &&
+                    (expectedDistances[index] != 0.5) && (newDistance != 0.2))
+                {
+                    System.out.println((index ) + ": distance between " + guiElementArray[i] +
+                                       " and " + guiElementArray[j] + " changed due to condense. " +
+                                       "Was " + expectedDistances[index] + " and is now " +
+                                       guiElementArray[i].getDistanceTo(guiElementArray[j]) + ".");
+                }
+                
+                index++;
+                
+                if (index == checkSize) {
+                    break OUTER;
+                }
+            }
+        }
+        // <<<<<<<<<<<<<<<<<<<<<<<<<<<< Just to test the distance measure
+        
     }
 
