Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/EventTaskComparisonRuleTest.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/EventTaskComparisonRuleTest.java	(revision 807)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/EventTaskComparisonRuleTest.java	(revision 807)
@@ -0,0 +1,66 @@
+package de.ugoe.cs.quest.tasktrees.nodeequality;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import de.ugoe.cs.quest.eventcore.IEventTarget;
+import de.ugoe.cs.quest.eventcore.IEventType;
+import de.ugoe.cs.quest.eventcore.StringEventType;
+import de.ugoe.cs.quest.tasktrees.treeifc.ISelection;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactory;
+import de.ugoe.cs.quest.test.DummyGUIElement;
+
+/**
+ * @author Patrick Harms
+ */
+public class EventTaskComparisonRuleTest {
+
+    /**
+     *
+     */
+    @Test
+    public void test() {
+        ITaskTreeNodeFactory treeNodeFactory = new TaskTreeNodeFactory();
+        
+        EventTaskComparisonRule rule = new EventTaskComparisonRule();
+        
+        // test the identity check
+        IEventType eventType1 = new StringEventType("eventType1");
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        ITaskTreeNode task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        
+        assertEquals(NodeEquality.IDENTICAL, rule.compare(task1, task1));
+
+        ITaskTreeNode task2 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task2, task1));
+        
+        IEventType eventType2 = new StringEventType("eventType2");
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+        
+        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
+        task2 = treeNodeFactory.createNewEventTask(eventType1, eventTarget2);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+        
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget2);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+
+        ISelection selection = treeNodeFactory.createNewSelection();
+        assertNull(rule.compare(task1, selection));
+        assertNull(rule.compare(selection, task1));
+        assertNull(rule.compare(task2, selection));
+        assertNull(rule.compare(selection, task2));
+    }
+
+}
Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/GUIEventTaskComparisonRuleTest.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/GUIEventTaskComparisonRuleTest.java	(revision 807)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/GUIEventTaskComparisonRuleTest.java	(revision 807)
@@ -0,0 +1,131 @@
+package de.ugoe.cs.quest.tasktrees.nodeequality;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.eventcore.IEventTarget;
+import de.ugoe.cs.quest.eventcore.IEventType;
+import de.ugoe.cs.quest.eventcore.StringEventType;
+import de.ugoe.cs.quest.eventcore.gui.KeyboardFocusChange;
+import de.ugoe.cs.quest.eventcore.gui.TextInput;
+import de.ugoe.cs.quest.eventcore.gui.ValueSelection;
+import de.ugoe.cs.quest.tasktrees.treeifc.ISelection;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactory;
+import de.ugoe.cs.quest.test.DummyGUIElement;
+
+/**
+ * @author Patrick Harms
+ */
+public class GUIEventTaskComparisonRuleTest {
+
+    /**
+     *
+     */
+    @Test
+    public void test() {
+        ITaskTreeNodeFactory treeNodeFactory = new TaskTreeNodeFactory();
+        
+        GUIEventTaskComparisonRule rule = new GUIEventTaskComparisonRule();
+        
+        // test the identity check
+        IEventType eventType1 = new StringEventType("blub");
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        ITaskTreeNode task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        
+        assertNull(rule.compare(task1, task1));
+
+        eventType1 = new KeyboardFocusChange();
+        task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        
+        assertEquals(NodeEquality.IDENTICAL, rule.compare(task1, task1));
+
+        // test lexical equality for interaction events which are no value selections or text inputs
+        IEventType eventType2 = new KeyboardFocusChange();
+        ITaskTreeNode task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task2, task1));
+        
+        // test equality of value selections
+        eventType1 = new ValueSelection<String>("value1");
+        task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+        
+        eventType2 = new ValueSelection<String>("value1");
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+        
+        assertEquals(NodeEquality.SYNTACTICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.SYNTACTICALLY_EQUAL, rule.compare(task2, task1));
+        
+        eventType2 = new ValueSelection<String>("value2");
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+        
+        assertEquals(NodeEquality.SEMANTICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.SEMANTICALLY_EQUAL, rule.compare(task2, task1));
+        
+        // test equality of text inputs
+        List<Event> textInputEvents1 = new ArrayList<Event>();
+        textInputEvents1.add(new Event(eventType1, eventTarget1));
+        eventType1 = new TextInput("enteredText1", textInputEvents1);
+        task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+        
+        eventType2 = new TextInput("enteredText1", textInputEvents1);
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(task2, task1));
+        
+        List<Event> textInputEvents2 = new ArrayList<Event>();
+        textInputEvents2.add(new Event(eventType2, eventTarget1));
+        eventType2 = new TextInput("enteredText1", textInputEvents2);
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+        
+        assertEquals(NodeEquality.SYNTACTICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.SYNTACTICALLY_EQUAL, rule.compare(task2, task1));
+        
+        eventType2 = new TextInput("enteredText2", textInputEvents2);
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget1);
+        
+        assertEquals(NodeEquality.SEMANTICALLY_EQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.SEMANTICALLY_EQUAL, rule.compare(task2, task1));
+        
+        // now ensure unequality for all combinations, if the event targets do not match
+        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
+        eventType1 = new KeyboardFocusChange();
+        task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        task2 = treeNodeFactory.createNewEventTask(eventType2, eventTarget2);
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+        
+        eventType1 = new ValueSelection<String>("value1");
+        task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        task2 = treeNodeFactory.createNewEventTask(eventType1, eventTarget2);
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+        
+        eventType1 = new TextInput("enteredText1", textInputEvents1);
+        task1 = treeNodeFactory.createNewEventTask(eventType1, eventTarget1);
+        task2 = treeNodeFactory.createNewEventTask(eventType1, eventTarget2);
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task1, task2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(task2, task1));
+
+        ISelection selection = treeNodeFactory.createNewSelection();
+        assertNull(rule.compare(task1, selection));
+        assertNull(rule.compare(selection, task1));
+        assertNull(rule.compare(task2, selection));
+        assertNull(rule.compare(selection, task2));
+    }
+
+}
Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/IterationComparisonRuleTest.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/IterationComparisonRuleTest.java	(revision 807)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/IterationComparisonRuleTest.java	(revision 807)
@@ -0,0 +1,92 @@
+package de.ugoe.cs.quest.tasktrees.nodeequality;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import de.ugoe.cs.quest.tasktrees.treeifc.IIteration;
+import de.ugoe.cs.quest.tasktrees.treeifc.ISelection;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeBuilder;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeBuilder;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNode;
+
+/**
+ * @author Patrick Harms
+ */
+public class IterationComparisonRuleTest {
+
+    /**
+     *
+     */
+    @Test
+    public void test() {
+        NodeEqualityRuleManager manager = new NodeEqualityRuleManager();
+        manager.init();
+        
+        ITaskTreeNodeFactory treeNodeFactory = new TaskTreeNodeFactory();
+        ITaskTreeBuilder treeBuilder = new TaskTreeBuilder();
+        
+        IterationComparisonRule rule = new IterationComparisonRule(manager);
+        
+        ITaskTreeNode task1 = new TaskTreeNode("task1");
+        ITaskTreeNode task2 = new TaskTreeNode("task2");
+        
+        assertNull(rule.compare(task1, task2));
+        
+        IIteration iteration1 = treeNodeFactory.createNewIteration();
+        assertEquals(NodeEquality.IDENTICAL, rule.compare(iteration1, iteration1));
+
+        IIteration iteration2 = treeNodeFactory.createNewIteration();
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1));
+        
+        treeBuilder.setChild(iteration1, task1);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(iteration2, iteration1));
+        
+        treeBuilder.setChild(iteration2, task1);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1));
+        
+        treeBuilder.setChild(iteration1, task2);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(iteration2, iteration1));
+        
+        treeBuilder.setChild(iteration2, task2);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1));
+        
+        ISelection selection1 = treeNodeFactory.createNewSelection();
+        treeBuilder.addChild(selection1, task2);
+        treeBuilder.setChild(iteration1, selection1);
+        
+        assertEquals(NodeEquality.SYNTACTICALLY_EQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.SYNTACTICALLY_EQUAL, rule.compare(iteration2, iteration1));
+        
+        ISelection selection2 = treeNodeFactory.createNewSelection();
+        treeBuilder.addChild(selection2, task2);
+        treeBuilder.setChild(iteration2, selection2);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration1, iteration2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(iteration2, iteration1));
+        
+        assertNull(rule.compare(iteration1, selection1));
+        assertNull(rule.compare(selection1, iteration1));
+        assertNull(rule.compare(iteration2, selection1));
+        assertNull(rule.compare(selection1, iteration2));
+
+        assertNull(rule.compare(iteration1, selection2));
+        assertNull(rule.compare(selection2, iteration1));
+        assertNull(rule.compare(iteration2, selection2));
+        assertNull(rule.compare(selection2, iteration2));
+    }
+
+}
Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityTest.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityTest.java	(revision 806)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityTest.java	(revision 807)
@@ -6,13 +6,9 @@
 
 /**
- * TODO comment
- * 
- * @version $Revision: $ $Date: 15.08.2012$
- * @author 2012, last modified by $Author: pharms$
+ * @author Patrick Harms
  */
 public class NodeEqualityTest {
 
     /**
-     * TODO: comment
      *
      */
Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SelectionComparisonRuleTest.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SelectionComparisonRuleTest.java	(revision 807)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SelectionComparisonRuleTest.java	(revision 807)
@@ -0,0 +1,86 @@
+package de.ugoe.cs.quest.tasktrees.nodeequality;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import de.ugoe.cs.quest.tasktrees.treeifc.ISelection;
+import de.ugoe.cs.quest.tasktrees.treeifc.ISequence;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeBuilder;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeBuilder;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNodeFactory;
+import de.ugoe.cs.quest.tasktrees.treeimpl.TaskTreeNode;
+
+/**
+ * @author Patrick Harms
+ */
+public class SelectionComparisonRuleTest {
+
+    /**
+     * 
+     */
+    @Test
+    public void test() {
+        NodeEqualityRuleManager manager = new NodeEqualityRuleManager();
+        manager.init();
+        
+        ITaskTreeNodeFactory treeNodeFactory = new TaskTreeNodeFactory();
+        ITaskTreeBuilder treeBuilder = new TaskTreeBuilder();
+        
+        SelectionComparisonRule rule = new SelectionComparisonRule(manager);
+        
+        ITaskTreeNode task1 = new TaskTreeNode("task1");
+        ITaskTreeNode task2 = new TaskTreeNode("task2");
+        
+        assertNull(rule.compare(task1, task2));
+        
+        ISelection selection1 = treeNodeFactory.createNewSelection();
+        assertEquals(NodeEquality.IDENTICAL, rule.compare(selection1, selection1));
+
+        ISelection selection2 = treeNodeFactory.createNewSelection();
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1));
+        
+        treeBuilder.addChild(selection1, task1);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(selection1, selection2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(selection2, selection1));
+        
+        treeBuilder.addChild(selection2, task1);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1));
+        
+        treeBuilder.addChild(selection1, task2);
+        
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(selection1, selection2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(selection2, selection1));
+        
+        treeBuilder.addChild(selection2, task2);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection2));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection1));
+        
+        ISelection selection3 = treeNodeFactory.createNewSelection();
+        treeBuilder.addChild(selection3, task2);
+        treeBuilder.addChild(selection3, task1);
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection1, selection3));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection3, selection1));
+        
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection2, selection3));
+        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(selection3, selection2));
+
+        ISequence sequence = treeNodeFactory.createNewSequence();
+        assertNull(rule.compare(selection1, sequence));
+        assertNull(rule.compare(sequence, selection1));
+        assertNull(rule.compare(selection2, sequence));
+        assertNull(rule.compare(sequence, selection2));
+        assertNull(rule.compare(selection3, sequence));
+        assertNull(rule.compare(sequence, selection3));
+    }
+
+}
Index: /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRuleTest.java
===================================================================
--- /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRuleTest.java	(revision 806)
+++ /trunk/quest-core-tasktrees-test/src/test/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRuleTest.java	(revision 807)
@@ -5,4 +5,5 @@
 import org.junit.Test;
 
+import de.ugoe.cs.quest.tasktrees.treeifc.ISelection;
 import de.ugoe.cs.quest.tasktrees.treeifc.ISequence;
 import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeBuilder;
@@ -14,18 +15,10 @@
 
 /**
- * <p>
- * TODO comment
- * </p>
- * 
- * @version $Revision: $ $Date: 16.08.2012$
- * @author 2012, last modified by $Author: pharms$
+ * @author Patrick Harms
  */
 public class SequenceComparisonRuleTest {
 
     /**
-     * <p>
-     * TODO: comment
-     * </p>
-     *
+     * 
      */
     @Test
@@ -45,5 +38,5 @@
         
         ISequence sequence1 = treeNodeFactory.createNewSequence();
-        assertEquals(NodeEquality.LEXICALLY_EQUAL, rule.compare(sequence1, sequence1));
+        assertEquals(NodeEquality.IDENTICAL, rule.compare(sequence1, sequence1));
 
         ISequence sequence2 = treeNodeFactory.createNewSequence();
@@ -54,6 +47,6 @@
         treeBuilder.addChild(sequence1, task1);
         
-        assertNull(rule.compare(sequence1, sequence2));
-        assertNull(rule.compare(sequence2, sequence1));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence1, sequence2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence2, sequence1));
         
         treeBuilder.addChild(sequence2, task1);
@@ -64,6 +57,6 @@
         treeBuilder.addChild(sequence1, task2);
         
-        assertNull(rule.compare(sequence1, sequence2));
-        assertNull(rule.compare(sequence2, sequence1));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence1, sequence2));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence2, sequence1));
         
         treeBuilder.addChild(sequence2, task2);
@@ -76,6 +69,16 @@
         treeBuilder.addChild(sequence3, task1);
         
-        assertNull(rule.compare(sequence1, sequence3));
-        assertNull(rule.compare(sequence3, sequence1));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence1, sequence3));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence3, sequence1));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence2, sequence3));
+        assertEquals(NodeEquality.UNEQUAL, rule.compare(sequence3, sequence2));
+
+        ISelection selection = treeNodeFactory.createNewSelection();
+        assertNull(rule.compare(sequence1, selection));
+        assertNull(rule.compare(selection, sequence1));
+        assertNull(rule.compare(sequence2, selection));
+        assertNull(rule.compare(selection, sequence2));
+        assertNull(rule.compare(sequence3, selection));
+        assertNull(rule.compare(selection, sequence3));
     }
 
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/EventTaskComparisonRule.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/EventTaskComparisonRule.java	(revision 807)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/EventTaskComparisonRule.java	(revision 807)
@@ -0,0 +1,44 @@
+package de.ugoe.cs.quest.tasktrees.nodeequality;
+
+import de.ugoe.cs.quest.tasktrees.treeifc.IEventTask;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode;
+
+/**
+ * <p>
+ * This rule identifies two task tree nodes as lexically equal, if they are both event tasks and
+ * if their respective event types and targets equal. 
+ * </p>
+ * 
+ * @author Patrick Harms
+ */
+public class EventTaskComparisonRule implements NodeComparisonRule {
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.tasktree.nodeequality.NodeEqualityRule#apply(TaskTreeNode, TaskTreeNode)
+     */
+    @Override
+    public NodeEquality compare(ITaskTreeNode node1, ITaskTreeNode node2) {
+        if ((!(node1 instanceof IEventTask)) || (!(node2 instanceof IEventTask))) {
+            return null;
+        }
+
+        if (node1 == node2) {
+            return NodeEquality.IDENTICAL;
+        }
+
+        IEventTask task1 = (IEventTask) node1;
+        IEventTask task2 = (IEventTask) node2;
+        
+        if (task1.getEventType().equals(task2.getEventType()) &&
+            task1.getEventTarget().equals(task2.getEventTarget()))
+        {
+            return NodeEquality.LEXICALLY_EQUAL;
+        }
+        else {
+            return NodeEquality.UNEQUAL;
+        }
+    }
+
+}
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/GUIEventTaskComparisonRule.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/GUIEventTaskComparisonRule.java	(revision 807)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/GUIEventTaskComparisonRule.java	(revision 807)
@@ -0,0 +1,147 @@
+package de.ugoe.cs.quest.tasktrees.nodeequality;
+
+import de.ugoe.cs.quest.eventcore.gui.IInteraction;
+import de.ugoe.cs.quest.eventcore.gui.TextInput;
+import de.ugoe.cs.quest.eventcore.gui.ValueSelection;
+import de.ugoe.cs.quest.tasktrees.treeifc.IEventTask;
+import de.ugoe.cs.quest.tasktrees.treeifc.ITaskTreeNode;
+
+/**
+ * <p>
+ * This rule compares GUI event tasks (i.e. it is more concrete, than the
+ * {@link EventTaskComparisonRule}). Two GUI event tasks are only equal if their event type and
+ * target are equal. The returned equality is even more fine-grained for events whose type is
+ * {@link TextInput} and {@link ValueSelection}. For text inputs, lexical equality is returned if
+ * the same text is entered using the same key interactions. Syntactical equality is returned if
+ * the same text is entered using different key interactions. Semantical equality is returned if
+ * different text is entered, but into the same event target. Value selections are syntactically
+ * equal, if the same value is selected. Otherwise they are semantically equal.
+ * </p>
+ * 
+ * @author Patrick Harms
+ */
+public class GUIEventTaskComparisonRule implements NodeComparisonRule {
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see de.ugoe.cs.tasktree.nodeequality.NodeEqualityRule#apply(TaskTreeNode, TaskTreeNode)
+     */
+    @Override
+    public NodeEquality compare(ITaskTreeNode node1, ITaskTreeNode node2) {
+        if ((!(node1 instanceof IEventTask)) || (!(node2 instanceof IEventTask))) {
+            return null;
+        }
+        
+        IEventTask task1 = (IEventTask) node1;
+        IEventTask task2 = (IEventTask) node2;
+        
+        if ((!(task1.getEventType() instanceof IInteraction)) ||
+            (!(task2.getEventType() instanceof IInteraction)))
+        {
+            return null;
+        }
+
+        if (node1 == node2) {
+            return NodeEquality.IDENTICAL;
+        }
+
+        if (!task1.getEventTarget().equals(task2.getEventTarget())) {
+            return NodeEquality.UNEQUAL;
+        }
+        
+        IInteraction interaction1 = (IInteraction) task1.getEventType();
+        IInteraction interaction2 = (IInteraction) task2.getEventType();
+        
+        return compareInteractions(interaction1, interaction2);
+    }
+
+    /**
+     * <p>
+     * compares two interactions. The method delegates two
+     * {@link #compareTextInputs(TextInput, TextInput)} and
+     * {@link #compareValueSelections(ValueSelection, ValueSelection)} for text inputs and value
+     * selections. Otherwise it uses the equal method of the interactions for comparison. In this
+     * case, if the interactions equal method returns true, this method returns lexical equality.
+     * </p>
+     *
+     * @param interaction1 the first interaction to compare
+     * @param interaction2 the second interaction to compare
+     * 
+     * @return as described
+     */
+    private NodeEquality compareInteractions(IInteraction interaction1, IInteraction interaction2) {
+        if (interaction1 == interaction2) {
+            return NodeEquality.LEXICALLY_EQUAL;
+        }
+        else if ((interaction1 instanceof TextInput) && (interaction2 instanceof TextInput)) {
+            return compareTextInputs((TextInput) interaction1, (TextInput) interaction2);
+        }
+        else if ((interaction1 instanceof ValueSelection) &&
+                 (interaction2 instanceof ValueSelection))
+        {
+            return compareValueSelections
+                ((ValueSelection<?>) interaction1, (ValueSelection<?>) interaction2);
+        }
+        else if (interaction1.equals(interaction2)) {
+            return NodeEquality.LEXICALLY_EQUAL;
+        }
+        else {
+            return NodeEquality.UNEQUAL;
+        }
+    }
+
+    /**
+     * <p>
+     * compares two text inputs. If both text inputs have the same entered text and text input
+     * events, they are lexically equal. If they only have the same entered text, they are
+     * syntactically equal. If they are only both text inputs, they are semantically equal.
+     * (the equality of the event targets is checked beforehand).
+     * </p>
+     *
+     * @param interaction1 the first text input to compare
+     * @param interaction2 the second text input to compare
+     * 
+     * @return as described
+     */
+    private NodeEquality compareTextInputs(TextInput interaction1, TextInput interaction2) {
+        if (interaction1.getEnteredText().equals(interaction2.getEnteredText())) {
+            if (interaction1.getTextInputEvents().equals(interaction2.getTextInputEvents())) {
+                return NodeEquality.LEXICALLY_EQUAL;
+            }
+            else {
+                return NodeEquality.SYNTACTICALLY_EQUAL;
+            }
+        }
+        else {
+            return NodeEquality.SEMANTICALLY_EQUAL;
+        }
+    }
+
+    /**
+     * <p>
+     * compares two value selections. If both value selections have the same selected value, they
+     * are syntactically equal, otherwise they are semantically equal.
+     * (the equality of the event targets is checked beforehand).
+     * </p>
+     *
+     * @param interaction1 the first value selection to compare
+     * @param interaction2 the second value selection to compare
+     * 
+     * @return as described
+     */
+    private NodeEquality compareValueSelections(ValueSelection<?> interaction1,
+                                                ValueSelection<?> interaction2)
+    {
+        Object value1 = interaction1.getSelectedValue();
+        Object value2 = interaction2.getSelectedValue();
+        
+        if ((value1 == value2) || ((value1 != null) && (value1.equals(value2)))) {
+            return NodeEquality.SYNTACTICALLY_EQUAL;
+        }
+        else {
+            return NodeEquality.SEMANTICALLY_EQUAL;
+        }
+    }
+
+}
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/IterationComparisonRule.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/IterationComparisonRule.java	(revision 806)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/IterationComparisonRule.java	(revision 807)
@@ -41,7 +41,19 @@
  *   </tr>
  *   <tr>
+ *     <td>an iteration with a selection of syntactically equal children</td>
+ *     <td>an iteration with a selection of syntactically equal children that are all syntactically
+ *     equal to the selection of children of iteration 1</td>
+ *     <td><code>NodeEquality.SYNTACTICALLY_EQUAL</code></td>
+ *   </tr>
+ *   <tr>
  *     <td>an iteration with a selection of semantically equal children</td>
  *     <td>an iteration with a child that is semantically equal to the children of the child
  *     selection of iteration 1</td>
+ *     <td><code>NodeEquality.SEMANTICALLY_EQUAL</code></td>
+ *   </tr>
+ *   <tr>
+ *     <td>an iteration with a selection of semantically equal children</td>
+ *     <td>an iteration with a selection of semantically equal children that are all semantically
+ *     equal to the selection of children of iteration 1</td>
  *     <td><code>NodeEquality.SEMANTICALLY_EQUAL</code></td>
  *   </tr>
@@ -80,7 +92,14 @@
         }
 
+        if (node1 == node2) {
+            return NodeEquality.IDENTICAL;
+        }
+
         // if both iterations do not have children, they are equal although this doesn't make sense
         if ((node1.getChildren().size() == 0) && (node2.getChildren().size() == 0)) {
-            return NodeEquality.IDENTICAL;
+            return NodeEquality.LEXICALLY_EQUAL;
+        }
+        else if ((node1.getChildren().size() == 0) || (node2.getChildren().size() == 0)) {
+            return NodeEquality.UNEQUAL;
         }
 
@@ -102,5 +121,12 @@
 
         if (nodeEquality.isAtLeast(NodeEquality.SEMANTICALLY_EQUAL)) {
-            return nodeEquality;
+            // prevent, that identical is returned, because the iterations itself are not identical
+            // although the iterated tasks are
+            if (nodeEquality == NodeEquality.IDENTICAL) {
+                return NodeEquality.LEXICALLY_EQUAL;
+            }
+            else {
+                return nodeEquality;
+            }
         }
 
@@ -115,9 +141,9 @@
     /**
      * <p>
-     * compares two task tree nodes. One of them must be a selection of at least semantically
-     * equal children. The other one can be any task tree node. The method returns a node equality
-     * that is not <code>NodeEquality.UNEQUAL</code> if the other node is at least semantically
-     * equal to the children of the selection. It returns more concrete equalities, if the
-     * equality between the other node and the children of the selection is more concrete.
+     * compares two task tree nodes. One of them must be a selection, the other one can be any task
+     * tree node. The method returns a node equality that is not <code>NodeEquality.UNEQUAL</code>
+     * if the other node is at least semantically equal to the children of the selection. It
+     * returns more concrete equalities, if the equality between the other node and the children
+     * of the selection is more concrete.
      * </p> 
      * 
@@ -144,18 +170,21 @@
         }
 
-        NodeEquality lessConcreteEqualityForAllComparisons = NodeEquality.IDENTICAL;
+        // Iterations, where one has a selection and the other one not can at most be syntactically
+        // equal but not identical
+        NodeEquality commonDenominatorForAllComparisons = NodeEquality.SYNTACTICALLY_EQUAL;
 
         for (ITaskTreeNode child : selection.getChildren()) {
             NodeEquality nodeEquality = mRuleManager.applyRules(node, child);
 
-            if (!nodeEquality.isAtLeast(NodeEquality.SEMANTICALLY_EQUAL)) {
+            if ((nodeEquality == null) || (nodeEquality == NodeEquality.UNEQUAL))
+            {
                 return NodeEquality.UNEQUAL;
             }
-            else if (!lessConcreteEqualityForAllComparisons.isAtLeast(nodeEquality)) {
-                lessConcreteEqualityForAllComparisons = nodeEquality;
-            }
+            
+            commonDenominatorForAllComparisons =
+                commonDenominatorForAllComparisons.getCommonDenominator(nodeEquality);
         }
 
-        return lessConcreteEqualityForAllComparisons;
+        return commonDenominatorForAllComparisons;
     }
 
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEquality.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEquality.java	(revision 806)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEquality.java	(revision 807)
@@ -90,3 +90,24 @@
         }
     }
+
+    /**
+     * <p>
+     * returns the common denominator of this node equality and the provided one. I.e. if one
+     * equality is e.g. syntactical and the other one only semantical, then semantical is returned.
+     * </p>
+     *
+     * @param equality the equality, to compare this with
+     * @return
+     */
+    public NodeEquality getCommonDenominator(NodeEquality otherEquality) {
+        if (this.isAtLeast(otherEquality)) {
+            return otherEquality;
+        }
+        else if (otherEquality.isAtLeast(this)) {
+            return this;
+        }
+        else {
+            return NodeEquality.UNEQUAL;
+        }
+    }
 }
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityRuleManager.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityRuleManager.java	(revision 806)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeEqualityRuleManager.java	(revision 807)
@@ -33,4 +33,6 @@
         mRuleIndex = new ArrayList<NodeComparisonRule>();
         mRuleIndex.add(new NodeIdentityRule());
+        mRuleIndex.add(new GUIEventTaskComparisonRule());
+        mRuleIndex.add(new EventTaskComparisonRule());
         mRuleIndex.add(new IterationComparisonRule(this));
         mRuleIndex.add(new SequenceComparisonRule(this));
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeIdentityRule.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeIdentityRule.java	(revision 806)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/NodeIdentityRule.java	(revision 807)
@@ -22,5 +22,5 @@
     @Override
     public NodeEquality compare(ITaskTreeNode node1, ITaskTreeNode node2) {
-        if ((node1 == node2) || ((node1 != null) && (node1.equals(node2)))) {
+        if (node1 == node2) {
             return NodeEquality.IDENTICAL;
         }
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SelectionComparisonRule.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SelectionComparisonRule.java	(revision 806)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SelectionComparisonRule.java	(revision 807)
@@ -7,9 +7,11 @@
  * <p>
  * this node comparison rule is capable of comparing selections. If both selections do not have
- * children, they are treated as lexically equal. If they have the same number of children other
- * than 0 and all these children are lexically equal, then the selections are lexically equal.
- * They are syntactically equal, if each child of both selections is syntactically equal to any
- * other child. The rule can not compare semantical equality if the nodes are not at least
- * syntactically equal and returns null, if it can not decide this.
+ * children, they are treated as identical. If they have children, each child of both selections
+ * is compared to each child of the respective other selection. The resulting equality is the most
+ * concrete one of all these comparisons. I.e. if all children are at least lexically equal, then
+ * the selections are lexically equal. If all children are at least syntactically equal, then the
+ * selections are syntactically equal. If all children are at least semantically equal, then the
+ * selections are semantically equal. If only one of the selections has children, then the
+ * selections are unequal.
  * </p>
  * 
@@ -46,43 +48,69 @@
         }
 
-        // if both sequences do not have children, they are equal although this doesn't make sense
+        if (node1 == node2) {
+            return NodeEquality.IDENTICAL;
+        }
+
+        // if both sequences do not have children, they are identical. If only one of them has
+        // children, they are unequal.
         if ((node1.getChildren().size() == 0) && (node2.getChildren().size() == 0)) {
             return NodeEquality.LEXICALLY_EQUAL;
         }
+        else if ((node1.getChildren().size() == 0) || (node2.getChildren().size() == 0)) {
+            return NodeEquality.UNEQUAL;
+        }
 
-        // Selections are syntactically equal, if they have children, which are all syntactically
-        // equal.
-        // They are lexically equals, if they have the same number and order of lexically equal
-        // children
-        boolean lexicallyEqual = node1.getChildren().size() == node2.getChildren().size();
+        NodeEquality selectionEquality = NodeEquality.LEXICALLY_EQUAL;
 
-        for (int i = 0; i < node1.getChildren().size(); i++) {
-            ITaskTreeNode child1 = node1.getChildren().get(i);
-            boolean foundLexicallyEqualChild = false;
-
-            for (int j = 0; j < node2.getChildren().size(); j++) {
-                ITaskTreeNode child2 = node2.getChildren().get(j);
-
-                NodeEquality nodeEquality = mRuleManager.applyRules(child1, child2);
-
-                if (!nodeEquality.isAtLeast(NodeEquality.SYNTACTICALLY_EQUAL)) {
-                    return null;
-                }
-                else if (nodeEquality.isAtLeast(NodeEquality.LEXICALLY_EQUAL)) {
-                    foundLexicallyEqualChild = true;
+        // compare each child of selection one with each child of selection two
+        NodeEquality childEquality;
+        NodeEquality currentEquality;
+        for (ITaskTreeNode child1 : node1.getChildren()) {
+            childEquality = null;
+            for (ITaskTreeNode child2 : node2.getChildren()) {
+                currentEquality = mRuleManager.applyRules(child1, child2);
+                if ((currentEquality != null) && (currentEquality != NodeEquality.UNEQUAL)) {
+                    if (childEquality == null) {
+                        childEquality = currentEquality;
+                    }
+                    else {
+                        childEquality = childEquality.getCommonDenominator(currentEquality);
+                    }
                 }
             }
-
-            // if we compare two children at the same position and if they are lexically equal
-            // then it can be further expected, that the selections are lexically equal
-            lexicallyEqual &= foundLexicallyEqualChild;
+            
+            if (childEquality != null) {
+                selectionEquality = selectionEquality.getCommonDenominator(childEquality);
+            }
+            else {
+                return NodeEquality.UNEQUAL;
+            }
         }
 
-        if (lexicallyEqual) {
-            return NodeEquality.LEXICALLY_EQUAL;
+        // compare each child of selection two with each child of selection one
+        for (ITaskTreeNode child2 : node2.getChildren()) {
+            childEquality = null;
+            for (ITaskTreeNode child1 : node1.getChildren()) {
+                currentEquality = mRuleManager.applyRules(child1, child2);
+                if ((currentEquality != null) && (currentEquality != NodeEquality.UNEQUAL)) {
+                    if (childEquality == null) {
+                        childEquality = currentEquality;
+                    }
+                    else {
+                        childEquality = childEquality.getCommonDenominator(currentEquality);
+                    }
+                }
+            }
+            
+            if (childEquality != null) {
+                selectionEquality = selectionEquality.getCommonDenominator(childEquality);
+            }
+            else {
+                return NodeEquality.UNEQUAL;
+            }
         }
-        else {
-            return NodeEquality.SYNTACTICALLY_EQUAL;
-        }
+
+        return selectionEquality;
     }
+
 }
Index: /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRule.java
===================================================================
--- /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRule.java	(revision 806)
+++ /trunk/quest-core-tasktrees/src/main/java/de/ugoe/cs/quest/tasktrees/nodeequality/SequenceComparisonRule.java	(revision 807)
@@ -44,4 +44,8 @@
         }
 
+        if (node1 == node2) {
+            return NodeEquality.IDENTICAL;
+        }
+
         // if both sequences do not have children, they are equal although this doesn't make sense
         if ((node1.getChildren().size() == 0) && (node2.getChildren().size() == 0)) {
@@ -49,9 +53,9 @@
         }
 
-        // 
         if (node1.getChildren().size() != node2.getChildren().size()) {
-            return null;
+            return NodeEquality.UNEQUAL;
         }
 
+        NodeEquality resultingEquality = NodeEquality.LEXICALLY_EQUAL;
         for (int i = 0; i < node1.getChildren().size(); i++) {
             ITaskTreeNode child1 = node1.getChildren().get(i);
@@ -60,10 +64,12 @@
             NodeEquality nodeEquality = mRuleManager.applyRules(child1, child2);
 
-            if (!nodeEquality.isAtLeast(NodeEquality.LEXICALLY_EQUAL)) {
-                return null;
+            if ((nodeEquality == null) || (nodeEquality == NodeEquality.UNEQUAL)) {
+                return NodeEquality.UNEQUAL;
             }
+            
+            resultingEquality = resultingEquality.getCommonDenominator(nodeEquality);
         }
 
-        return NodeEquality.LEXICALLY_EQUAL;
+        return resultingEquality;
     }
 
