Index: /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/GUIModel.java
===================================================================
--- /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/GUIModel.java	(revision 588)
+++ /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/GUIModel.java	(revision 589)
@@ -8,4 +8,5 @@
 
 import java.util.ArrayList;
+import java.util.LinkedList;
 import java.util.List;
 
@@ -106,32 +107,12 @@
         IGUIElementSpec specToIntegrateElementFor = remainingPath.remove(0);
         
-        List<TreeNode> matchingChildren = new ArrayList<TreeNode>();
-        int maximumSimilarity = 0;
+        List<TreeNode> matchingChildren = new LinkedList<TreeNode>();
         
         if (parentNode.children != null) {
             for (TreeNode child : parentNode.children) {
-                int similarityLevel = getSimilarityLevel
-                    (specToIntegrateElementFor, child.guiElement.getSpecification());
-                
-                if (similarityLevel >= maximumSimilarity) {
-                    if (maximumSimilarity == 100) {
-                        throw new GUIModelException
-                          ("several children of gui element " + parentNode.guiElement +
-                           " pretend to fully match specification " + specToIntegrateElementFor);
-                    }
-                    
-                    if (maximumSimilarity != similarityLevel) {
-                        matchingChildren.clear();
-                        maximumSimilarity = similarityLevel;
-                    }
-                    
+                if( specToIntegrateElementFor.getSimilarity(child.guiElement.getSpecification())) {
                     matchingChildren.add(child);
                 }
             }
-        }
-        
-        // we do not see something as matching if the similarity level is below 80%
-        if (maximumSimilarity < 80) {
-            matchingChildren.clear();
         }
         
@@ -150,39 +131,10 @@
         
         if (remainingPath.size() > 0) {
+            // TODO update spec here matchingChildren.get(0).guiElement
+            matchingChildren.get(0).guiElement.updateSpecification(specToIntegrateElementFor);
             return integratePath(matchingChildren.get(0), remainingPath, guiElementFactory);
         }
         else {
             return matchingChildren.get(0).guiElement;
-        }
-    }
-
-    /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
-     * @param spec1
-     * @param spec2
-     * @return
-     * @throws GUIModelException 
-     */
-    private int getSimilarityLevel(IGUIElementSpec spec1, IGUIElementSpec spec2)
-        throws GUIModelException
-    {
-        if (spec1 == spec2) {
-            return 100;
-        }
-        else if (spec1 != null) {
-            int level = spec1.getSimilarity(spec2);
-            
-            if ((level < 0) || (100 < level)) {
-               throw new GUIModelException("invalid tree node similarity provided (" + level +
-                                           "). Must be between 0 and 100."); 
-            }
-            
-            return level;
-        }
-        else {
-            return 0;
         }
     }
Index: /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/IGUIElement.java
===================================================================
--- /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/IGUIElement.java	(revision 588)
+++ /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/IGUIElement.java	(revision 589)
@@ -32,3 +32,5 @@
      */
     public int hashCode();
+
+    public void updateSpecification(IGUIElementSpec specToIntegrateElementFor);
 }
Index: /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/IGUIElementSpec.java
===================================================================
--- /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/IGUIElementSpec.java	(revision 588)
+++ /trunk/quest-core-events/src/main/java/de/ugoe/cs/quest/eventcore/guimodel/IGUIElementSpec.java	(revision 589)
@@ -33,5 +33,5 @@
      * @return
      */
-    public int getSimilarity(IGUIElementSpec otherParameters);
+    public boolean getSimilarity(IGUIElementSpec otherParameters);
 
     /**
Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/testutils/DummyGUIElement.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/testutils/DummyGUIElement.java	(revision 588)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/testutils/DummyGUIElement.java	(revision 589)
@@ -9,4 +9,5 @@
 import de.ugoe.cs.quest.eventcore.guimodel.AbstractDefaultGUIElement;
 import de.ugoe.cs.quest.eventcore.guimodel.IGUIElement;
+import de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec;
 
 /**
@@ -59,3 +60,8 @@
     }
 
+    @Override
+    public void updateSpecification(IGUIElementSpec specToIntegrateElementFor) {
+        // dummy
+    }
+
 }
Index: /trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElement.java
===================================================================
--- /trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElement.java	(revision 588)
+++ /trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElement.java	(revision 589)
@@ -8,4 +8,5 @@
 
 import de.ugoe.cs.quest.eventcore.guimodel.AbstractDefaultGUIElement;
+import de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec;
 
 /**
@@ -79,3 +80,11 @@
     }
 
+    @Override
+    public void updateSpecification(IGUIElementSpec updateSpecification) {
+        if( updateSpecification instanceof JFCGUIElementSpec ) {
+            specification.setName(((JFCGUIElementSpec) updateSpecification).getName());
+            specification.setElementHash(((JFCGUIElementSpec) updateSpecification).getElementHash());
+        }
+    }
+
 }
Index: /trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElementSpec.java
===================================================================
--- /trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElementSpec.java	(revision 588)
+++ /trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/guimodel/JFCGUIElementSpec.java	(revision 589)
@@ -5,4 +5,9 @@
 // Copyright : Patrick Harms, 2012
 package de.ugoe.cs.quest.plugin.jfc.guimodel;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.commons.collections15.CollectionUtils;
 
 import de.ugoe.cs.quest.eventcore.guimodel.IGUIElementSpec;
@@ -19,5 +24,5 @@
 
     /** */
-    private String name = null;
+    private List<String> name = new LinkedList<String>();
     
     /** */
@@ -31,5 +36,5 @@
     
     /** */
-    private String elementHash = null;
+    private List<String> elementHash = new LinkedList<String>();
     
     /* (non-Javadoc)
@@ -37,39 +42,29 @@
      */
     @Override
-    public int getSimilarity(IGUIElementSpec other) {
+    public boolean getSimilarity(IGUIElementSpec other) {
         if (this == other)
         {
-            return 100;
+            return true;
         }
         
         if (!(other instanceof JFCGUIElementSpec))
         {
-            return 0;
+            return false;
         }
         
         JFCGUIElementSpec otherSpec = (JFCGUIElementSpec) other;
-        int result = 0;
-
-        if ((type == otherSpec.type) || ((type != null) && (type.equals(otherSpec.type)))) {
-            result += 50;
-        }
-
-        if ((icon == otherSpec.icon) || ((icon != null) && (icon.equals(otherSpec.icon)))) {
-            result += 10;
-        }
-
-        if (index == otherSpec.index) {
-            result += 10;
-        }
-
-        if ((name == otherSpec.name) || ((name != null) && (name.equals(otherSpec.name)))) {
-            result += 15;
-        }
-
-        if (elementHash == otherSpec.elementHash || ((elementHash!=null) && elementHash.equals(otherSpec.elementHash))) {
-            result += 15;
+        
+        boolean retVal = false;
+        
+        boolean titleEqual = CollectionUtils.containsAny(name, otherSpec.name);
+        boolean hashEqual = CollectionUtils.containsAny(elementHash, otherSpec.elementHash);
+        
+        if( type.equals("Class") ) {
+            retVal = type.equals(otherSpec.type) && (titleEqual || hashEqual);
+        } else {
+            retVal = type.equals(otherSpec.type) && index==otherSpec.index && (titleEqual || hashEqual);
         }
         
-        return result;
+        return retVal;
     }
 
@@ -102,5 +97,9 @@
      */
     public String getName() {
-        return name;
+        // TODO for now always returns first matched name
+        if( name.isEmpty() ) {
+            return null;
+        }
+        return name.get(0);
     }
 
@@ -130,5 +129,9 @@
      */
     public String getElementHash() {
-        return elementHash;
+        // TODO for now always returns the first hash value
+        if( elementHash.isEmpty() ) {
+            return null;
+        }
+        return elementHash.get(0);
     }
 
@@ -137,5 +140,7 @@
      */
     public void setName(String name) {
-        this.name = name;
+        if( !this.name.contains(name) && name!=null ) {
+            this.name.add(name);
+        }
     }
 
@@ -165,5 +170,7 @@
      */
     public void setElementHash(String elementHash) {
-        this.elementHash = elementHash;
+        if( !this.elementHash.contains(elementHash) ) {
+            this.elementHash.add(elementHash);
+        }
     }
 
