Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java	(revision 1109)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java	(revision 1127)
@@ -184,8 +184,8 @@
             }
             else {
-                status = RuleApplicationStatus.RULE_NOT_APPLIED;
-            }
-            
-            assertTrue(status != RuleApplicationStatus.RULE_APPLICATION_FEASIBLE);
+                status = RuleApplicationStatus.NOT_APPLIED;
+            }
+            
+            assertTrue(status != RuleApplicationStatus.FEASIBLE);
             
             if ((result != null) && (result.getNewlyCreatedParentNodes() != null)) {
@@ -195,11 +195,10 @@
             }
             
-            if (status == RuleApplicationStatus.RULE_NOT_APPLIED) {
+            if (status == RuleApplicationStatus.NOT_APPLIED) {
                 toBeAppliedOn.pop();
             }
             
         }
-        while ((!toBeAppliedOn.isEmpty()) ||
-               (status == RuleApplicationStatus.RULE_APPLICATION_FINISHED));
+        while ((!toBeAppliedOn.isEmpty()) || (status == RuleApplicationStatus.FINISHED));
 
         return taskTreeNodeFactory.createTaskTree(sequence);
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultGuiElementSequenceDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultGuiElementSequenceDetectionRuleTest.java	(revision 1109)
+++ 	(revision )
@@ -1,238 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
-
-import org.junit.Test;
-
-import de.ugoe.cs.autoquest.eventcore.IEventTarget;
-import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
-import de.ugoe.cs.autoquest.test.DummyGUIElement;
-import de.ugoe.cs.autoquest.test.DummyInteraction;
-
-/**
- * TODO comment
- * 
- * @version $Revision: $ $Date: $
- * @author 2011, last modified by $Author: $
- */
-public class DefaultGuiElementSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC {
-    
-    /**
-     *
-     */
-    @Test
-    public void testOneInteractionOnOneElement() {
-        simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1"));
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence {" +
-             "  Event bla {}" +
-             "}", getTaskTree());
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testManyInteractionsOnOneElement() {
-        IEventTarget eventTarget = new DummyGUIElement("elem1");
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget);
-        simulateEvent(new DummyInteraction("blo", 1), eventTarget);
-        simulateEvent(new DummyInteraction("blu", 1), eventTarget);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence {" +
-             "  Event bla {}" +
-             "  Event bli {}" +
-             "  Event blo {}" +
-             "  Event blu {}" +
-             "  Event bla {}" +
-             "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null));
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testOneInteractionOnManyElements() {
-        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
-        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
-        IEventTarget eventTarget3 = new DummyGUIElement("elem3");
-        IEventTarget eventTarget4 = new DummyGUIElement("elem4");
-        IEventTarget eventTarget5 = new DummyGUIElement("elem5");
-        IEventTarget eventTarget6 = new DummyGUIElement("elem6");
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget2);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget3);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
-        simulateEvent(new DummyInteraction("blo", 1), eventTarget5);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget6);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Sequence sequence2 {" +
-             "    Event bli {}" +
-             "  }" +
-             "  Sequence sequence3 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Sequence sequence4 {" +
-             "    Event bli {}" +
-             "  }" +
-             "  Sequence sequence5 {" +
-             "    Event blo {}" +
-             "  }" +
-             "  Sequence sequence6 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null));
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testManyInteractionsOnManyElementsWithoutHierarchy() {
-        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
-        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
-        IEventTarget eventTarget3 = new DummyGUIElement("elem3");
-        IEventTarget eventTarget4 = new DummyGUIElement("elem4");
-        IEventTarget eventTarget5 = new DummyGUIElement("elem5");
-        IEventTarget eventTarget6 = new DummyGUIElement("elem6");
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget1);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget2);
-        simulateEvent(new DummyInteraction("blo", 1), eventTarget2);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget3);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget4);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
-        simulateEvent(new DummyInteraction("blo", 1), eventTarget4);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget5);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget6);
-        simulateEvent(new DummyInteraction("bla", 1), eventTarget6);
-        simulateEvent(new DummyInteraction("bli", 1), eventTarget6);
-        simulateEvent(new DummyInteraction("blo", 1), eventTarget6);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "    Event bla {}" +
-             "  }" +
-             "  Sequence sequence2 {" +
-             "    Event bli {}" +
-             "    Event blo {}" +
-             "  }" +
-             "  Sequence sequence3 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Sequence sequence4 {" +
-             "    Event bli {}" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "    Event blo {}" +
-             "  }" +
-             "  Sequence sequence5 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Sequence sequence6 {" +
-             "    Event bli {}" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "    Event blo {}" +
-             "  }" +
-             "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null));
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testManyInteractionsOnManyElementsWithHierarchy() {
-        DummyGUIElement parentA = new DummyGUIElement("A");
-        DummyGUIElement parentB = new DummyGUIElement("B", parentA);
-        DummyGUIElement parentC = new DummyGUIElement("C", parentB);
-        DummyGUIElement parentF = new DummyGUIElement("F", parentB);
-        DummyGUIElement parentH = new DummyGUIElement("H", parentA);
-        DummyGUIElement parentI = new DummyGUIElement("I", parentH);
-        
-        DummyGUIElement eventTargetD = new DummyGUIElement("D", parentC);
-        DummyGUIElement eventTargetE = new DummyGUIElement("E", parentC);
-        DummyGUIElement eventTargetG = new DummyGUIElement("G", parentF);
-        DummyGUIElement eventTargetJ = new DummyGUIElement("J", parentI);
-        
-        simulateEvent(new DummyInteraction("1", 1), eventTargetD);
-        simulateEvent(new DummyInteraction("2", 1), eventTargetD);
-        simulateEvent(new DummyInteraction("3", 1), eventTargetE);
-        simulateEvent(new DummyInteraction("4", 1), eventTargetD);
-        simulateEvent(new DummyInteraction("5", 1), eventTargetG);
-        simulateEvent(new DummyInteraction("6", 1), eventTargetG);
-        simulateEvent(new DummyInteraction("7", 1), eventTargetD);
-        simulateEvent(new DummyInteraction("8", 1), eventTargetJ);
-        simulateEvent(new DummyInteraction("9", 1), eventTargetG);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Sequence sequence2 {" +
-             "      Sequence sequence3 {" +
-             "        Event 1 {}" +
-             "        Event 2 {}" +
-             "      }" +
-             "      Sequence sequence4 {" +
-             "        Event 3 {}" +
-             "      }" +
-             "      Sequence sequence5 {" +
-             "        Event 4 {}" +
-             "      }" +
-             "    }" +
-             "    Sequence sequence6 {" +
-             "      Sequence sequence7 {" +
-             "        Event 5 {}" +
-             "        Event 6 {}" +
-             "      }" +
-             "    }" +
-             "    Sequence sequence8 {" +
-             "      Sequence sequence9 {" +
-             "        Event 7 {}" +
-             "      }" +
-             "    }" +
-             "  }" +
-             "  Sequence sequence10 {" +
-             "    Sequence sequence11 {" +
-             "      Sequence sequence12 {" +
-             "        Event 8 {}" +
-             "      }" +
-             "    }" +
-             "  }" +
-             "  Sequence sequence13 {" +
-             "    Sequence sequence14 {" +
-             "      Sequence sequence15 {" +
-             "        Event 9 {}" +
-             "      }" +
-             "    }" +
-             "  }" +
-             "}", getTaskTree(DefaultGuiElementSequenceDetectionRule.class, null));
-    }
-
-}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultGuiEventSequenceDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultGuiEventSequenceDetectionRuleTest.java	(revision 1109)
+++ 	(revision )
@@ -1,347 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
-
-import org.junit.Test;
-
-import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
-import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
-import de.ugoe.cs.autoquest.test.DummyGUIElement;
-import de.ugoe.cs.autoquest.test.DummyInteraction;
-
-/**
- * TODO comment
- * 
- * @version $Revision: $ $Date: $
- * @author 2011, last modified by $Author: $
- */
-public class DefaultGuiEventSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC {
-    
-    /**
-     *
-     */
-    @Test
-    public void test_01() {
-        IGUIElement elem1 = new DummyGUIElement("elem1");
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence {" +
-             "  Event start {}" +
-             "  Event end {}" +
-             "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null));
-    }
-    
-    
-    /**
-     *
-     */
-    @Test
-    public void test_02() {
-        IGUIElement elem1 = new DummyGUIElement("elem1");
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence {" +
-             "  Event start {}" +
-             "  Event bla {}" +
-             "  Event end {}" +
-             "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null));
-    }
-    
-    /**
-     *
-     */
-    @Test
-    public void test_03() {
-        IGUIElement elem1 = new DummyGUIElement("elem1");
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new DummyInteraction("blup", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Event start {}" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "    Event blup {}" +
-             "    Event end {}" +
-             "  }" +
-             "  Sequence sequence2 {" +
-             "    Event start {}" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "    Event end {}" +
-             "  }" +
-             "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null));
-    }
-    
-    /**
-     *
-     */
-    @Test
-    public void test_04() {
-        IGUIElement elem1 = new DummyGUIElement("elem1");
-        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new DummyInteraction("blup", 1), elem1);
-        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Event startFinish {}" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "    Event blup {}" +
-             "  }" +
-             "  Sequence sequence2 {" +
-             "    Event startFinish {}" +
-             "    Event bla {}" +
-             "    Event bli {}" +
-             "  }" +
-             "  Event startFinish {}" +
-             "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null));
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void test_05() {
-        IGUIElement elem1 = new DummyGUIElement("elem1");
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new DummyInteraction("blup", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("blup", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Event start {}" +
-             "    Event bla {}" +
-             "    Sequence sequence2 {" +
-             "      Event start {}" +
-             "      Sequence sequence3 {" +
-             "        Event start {}" +
-             "        Event bli {}" +
-             "        Event blup {}" +
-             "        Event finish {}" +
-             "      }" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event finish {}" +
-             "    }" +
-             "    Sequence sequence4 {" +
-             "      Event start {}" +
-             "      Sequence sequence5 {" +
-             "        Event start {}" +
-             "        Sequence sequence6 {" +
-             "          Event start {}" +
-             "          Event blup {}" +
-             "          Event finish {}" +
-             "        }" +
-             "        Event finish {}" +
-             "      }" +
-             "      Event finish {}" +
-             "    }" +
-             "    Event finish {}" +
-             "  }" +
-             "  Event finish {}" +
-             "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null));
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void test_06() {
-        IGUIElement elem1 = new DummyGUIElement("elem1");
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new DummyInteraction("blup", 1), elem1);
-        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
-        simulateEvent(new DummyInteraction("bla", 1), elem1);
-        simulateEvent(new DummyInteraction("bli", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
-        simulateEvent(new DummyInteraction("blup", 1), elem1);
-        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Sequence sequence1 {" +
-             "    Event start {}" +
-             "    Event bla {}" +
-             "    Sequence sequence2 {" +
-             "      Event start {}" +
-             "      Sequence sequence3 {" +
-             "        Event start {}" +
-             "        Event bli {}" +
-             "        Event blup {}" +
-             "      }" +
-             "      Sequence sequence4 {" +
-             "        Event startFinish {}" +
-             "        Event bla {}" +
-             "        Event bli {}" +
-             "        Event finish {}" +
-             "      }" +
-             "      Sequence sequence5 {" +
-             "        Event start {}" +
-             "        Sequence sequence6 {" +
-             "          Event start {}" +
-             "          Sequence sequence7 {" +
-             "            Event start {}" +
-             "            Event blup {}" +
-             "          }" +
-             "          Sequence sequence8 {" +
-             "            Event startFinish {}" +
-             "            Event finish {}" +
-             "          }" +
-             "          Event finish {}" +
-             "        }" +
-             "        Event finish {}" +
-             "      }" +
-             "      Event finish {}" +
-             "    }" +
-             "    Event finish {}" +
-             "  }" +
-             "  Event finish {}" +
-             "}", getTaskTree(DefaultGuiEventSequenceDetectionRule.class, null));
-    }
-    
-    /**
-     *
-     */
-    private class StartSequenceInteraction extends DummyInteraction {
-
-        /**  */
-        private static final long serialVersionUID = 1L;
-
-        /**
-         *
-         */
-        public StartSequenceInteraction(String interactionType, int interactionNumber) {
-            super(interactionType, interactionNumber);
-        }
-
-        /* (non-Javadoc)
-         * @see de.ugoe.cs.autoquest.test.DummyInteraction#startsLogicalSequence()
-         */
-        @Override
-        public boolean startsLogicalSequence() {
-            return true;
-        }
-        
-    }
-
-    /**
-     *
-     */
-    private class FinishSequenceInteraction extends DummyInteraction {
-
-        /**  */
-        private static final long serialVersionUID = 1L;
-
-        /**
-         *
-         */
-        public FinishSequenceInteraction(String interactionType, int interactionNumber) {
-            super(interactionType, interactionNumber);
-        }
- 
-        /* (non-Javadoc)
-         * @see de.ugoe.cs.autoquest.test.DummyInteraction#finishesLogicalSequence()
-         */
-        @Override
-        public boolean finishesLogicalSequence() {
-            return true;
-        }
-       
-    }
-
-    /**
-     *
-     */
-    private class StartAndFinishSequenceInteraction extends DummyInteraction {
-
-        /**  */
-        private static final long serialVersionUID = 1L;
-
-        /**
-         *
-         */
-        public StartAndFinishSequenceInteraction(String interactionType, int interactionNumber) {
-            super(interactionType, interactionNumber);
-        }
- 
-        /* (non-Javadoc)
-         * @see de.ugoe.cs.autoquest.test.DummyInteraction#startsLogicalSequence()
-         */
-        @Override
-        public boolean startsLogicalSequence() {
-            return true;
-        }
-        
-        /* (non-Javadoc)
-         * @see de.ugoe.cs.autoquest.test.DummyInteraction#finishesLogicalSequence()
-         */
-        @Override
-        public boolean finishesLogicalSequence() {
-            return true;
-        }
-       
-    }
-}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultIterationDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultIterationDetectionRuleTest.java	(revision 1109)
+++ 	(revision )
@@ -1,315 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
-
-import org.junit.Test;
-
-import de.ugoe.cs.autoquest.eventcore.IEventTarget;
-import de.ugoe.cs.autoquest.eventcore.IEventType;
-import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
-import de.ugoe.cs.autoquest.test.DummyGUIElement;
-import de.ugoe.cs.autoquest.test.DummyInteraction;
-
-/**
- * TODO comment
- * 
- * @version $Revision: $ $Date: 28.04.2012$
- * @author 2012, last modified by $Author: patrick$
- */
-public class DefaultIterationDetectionRuleTest extends AbstractTemporalRelationshipTC {
-
-    /**
-     *
-     */
-    @Test
-    public void testInteractionIterationDetection() throws Exception {
-        IEventTarget element1 = new DummyGUIElement("elem1");
-        IEventType event1 = new DummyInteraction("bla", 1);
-        simulateEvent(event1, element1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Event bla {}" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        simulateEvent(event1, element1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        simulateEvent(event1, element1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        for (int i = 0; i < 10; i++) {
-            simulateEvent(event1, element1);
-        }
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        // now test with preceding and trailing other events
-        IEventType event2 = new DummyInteraction("bli", 1);
-        IEventType event3 = new DummyInteraction("blup", 1);
-
-        simulateEvent(event2, element1);
-        simulateEvent(event3, element1);
-        for (int i = 0; i < 10; i++) {
-            simulateEvent(event1, element1);
-        }
-        simulateEvent(event3, element1);
-        simulateEvent(event2, element1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event bli {}" +
-             "  Event blup {}" +
-             "  Iteration iteration2 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event blup {}" +
-             "  Event bli {}" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        // now test with iterations of iterations
-
-        for (int i = 0; i < 10; i++) {
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event1, element1);
-            }
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event2, element1);
-            }
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event3, element1);
-            }
-        }
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event bli {}" +
-             "  Event blup {}" +
-             "  Iteration iteration2 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event blup {}" +
-             "  Event bli {}" +
-             "  Iteration iteration3 {" +
-             "    Sequence sequence2 {" +
-             "      Iteration iteration4 {" +
-             "        Event bla {}" +
-             "      }" +
-             "      Iteration iteration5 {" +
-             "        Event bli {}" +
-             "      }" +
-             "      Iteration iteration6 {" +
-             "        Event blup {}" +
-             "      }" +
-             "    }" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testSequenceIterationDetection() throws Exception {
-        IEventTarget element1 = new DummyGUIElement("elem1");
-        IEventType event1 = new DummyInteraction("bla", 1);
-        IEventType event2 = new DummyInteraction("bli", 1);
-        IEventType event3 = new DummyInteraction("blup", 1);
-        simulateEvent(event1, element1);
-        simulateEvent(event2, element1);
-        simulateEvent(event3, element1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Event bla {}" +
-             "  Event bli {}" +
-             "  Event blup {}" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        simulateEvent(event1, element1);
-        simulateEvent(event2, element1);
-        simulateEvent(event3, element1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        simulateEvent(event1, element1);
-        simulateEvent(event2, element1);
-        simulateEvent(event3, element1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        for (int i = 0; i < 10; i++) {
-            simulateEvent(event1, element1);
-            simulateEvent(event2, element1);
-            simulateEvent(event3, element1);
-        }
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        // now test with preceding and trailing other events
-        IEventType event4 = new DummyInteraction("ble", 1);
-        IEventType event5 = new DummyInteraction("blo", 1);
-        IEventType event6 = new DummyInteraction("blu", 1);
-        simulateEvent(event4, element1);
-        simulateEvent(event5, element1);
-        simulateEvent(event6, element1);
-        for (int i = 0; i < 10; i++) {
-            simulateEvent(event1, element1);
-            simulateEvent(event2, element1);
-            simulateEvent(event3, element1);
-        }
-        simulateEvent(event6, element1);
-        simulateEvent(event5, element1);
-        simulateEvent(event4, element1);
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "  Event ble {}" +
-             "  Event blo {}" +
-             "  Event blu {}" +
-             "  Iteration iteration2 {" +
-             "    Sequence sequence3 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "  Event blu {}" +
-             "  Event blo {}" +
-             "  Event ble {}" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-
-        // now test with iterations of iterations
-        for (int i = 0; i < 10; i++) {
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event1, element1);
-                simulateEvent(event2, element1);
-                simulateEvent(event3, element1);
-            }
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event2, element1);
-                simulateEvent(event1, element1);
-                simulateEvent(event3, element1);
-            }
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event1, element1);
-                simulateEvent(event2, element1);
-                simulateEvent(event3, element1);
-            }
-        }
-
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "  Event ble {}" +
-             "  Event blo {}" +
-             "  Event blu {}" +
-             "  Iteration iteration2 {" +
-             "    Sequence sequence3 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "  Event blu {}" +
-             "  Event blo {}" +
-             "  Event ble {}" +
-             "  Iteration iteration3 {" +
-             "    Sequence sequence4 {" +
-             "      Iteration iteration4 {" +
-             "        Sequence sequence4 {" +
-             "          Event bla {}" +
-             "          Event bli {}" +
-             "          Event blup {}" +
-             "        }" +
-             "      }" +
-             "      Iteration iteration5 {" +
-             "        Sequence sequence5 {" +
-             "          Event bli {}" +
-             "          Event bla {}" +
-             "          Event blup {}" +
-             "        }" +
-             "      }" +
-             "      Iteration iteration6 {" +
-             "        Sequence sequence6 {" +
-             "          Event bla {}" +
-             "          Event bli {}" +
-             "          Event blup {}" +
-             "        }" +
-             "      }" +
-             "    }" +
-             "  }" +
-             "}", getTaskTree(DefaultIterationDetectionRule.class, null));
-    }
-
-}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultTaskSequenceDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/DefaultTaskSequenceDetectionRuleTest.java	(revision 1109)
+++ 	(revision )
@@ -1,100 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
-
-import org.junit.Test;
-
-import de.ugoe.cs.autoquest.eventcore.IEventTarget;
-import de.ugoe.cs.autoquest.eventcore.gui.IInteraction;
-import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
-import de.ugoe.cs.autoquest.test.DummyGUIElement;
-import de.ugoe.cs.autoquest.test.DummyInteraction;
-
-/**
- * TODO comment
- * 
- * @version $Revision: $ $Date: 28.04.2012$
- * @author 2012, last modified by $Author: patrick$
- */
-public class DefaultTaskSequenceDetectionRuleTest extends AbstractTemporalRelationshipTC {
-
-    /**
-     *
-     */
-    @Test
-    public void testTaskDetection() throws Exception {
-        IEventTarget element1 = new DummyGUIElement("elem1");
-        
-        IInteraction action1 = new DummyInteraction("action1", 1);
-        IInteraction action2 = new DummyInteraction("action2", 1);
-        IInteraction action3 = new DummyInteraction("action3", 1);
-        IInteraction action4 = new DummyInteraction("action4", 1);
-        
-        simulateEvent(new DummyInteraction("noise0", 1), element1);
-        simulateEvent(action1, element1);
-        simulateEvent(action2, element1);
-        simulateEvent(action3, element1);
-        simulateEvent(action4, element1);
-        simulateEvent(new DummyInteraction("noise1", 1), element1);
-        simulateEvent(new DummyInteraction("noise2", 1), element1);
-        simulateEvent(action1, element1);
-        simulateEvent(action2, element1);
-        simulateEvent(action3, element1);
-        simulateEvent(action4, element1);
-        simulateEvent(new DummyInteraction("noise3", 1), element1);
-        simulateEvent(new DummyInteraction("noise4", 1), element1);
-        simulateEvent(new DummyInteraction("noise5", 1), element1);
-        simulateEvent(new DummyInteraction("noise6", 1), element1);
-        simulateEvent(action1, element1);
-        simulateEvent(action2, element1);
-        simulateEvent(action3, element1);
-        simulateEvent(action4, element1);
-        simulateEvent(new DummyInteraction("noise7", 1), element1);
-        simulateEvent(new DummyInteraction("noise8", 1), element1);
-        
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Event noise0 {}" +
-             "  Sequence sequence2 {" +
-             "    Event action1 {}" +
-             "    Event action2 {}" +
-             "    Event action3 {}" +
-             "    Event action4 {}" +
-             "  }" +
-             "  Event noise1 {}" +
-             "  Event noise2 {}" +
-             "  Sequence sequence2 {" +
-             "    Event action1 {}" +
-             "    Event action2 {}" +
-             "    Event action3 {}" +
-             "    Event action4 {}" +
-             "  }" +
-             "  Event noise3 {}" +
-             "  Event noise4 {}" +
-             "  Event noise5 {}" +
-             "  Event noise6 {}" +
-             "  Sequence sequence2 {" +
-             "    Event action1 {}" +
-             "    Event action2 {}" +
-             "    Event action3 {}" +
-             "    Event action4 {}" +
-             "  }" +
-             "  Event noise7 {}" +
-             "  Event noise8 {}" +
-             "}", getTaskTree());
-
-    }
-
-}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/IterationOfSubtreesDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/IterationOfSubtreesDetectionRuleTest.java	(revision 1127)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/IterationOfSubtreesDetectionRuleTest.java	(revision 1127)
@@ -0,0 +1,315 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+import de.ugoe.cs.autoquest.eventcore.IEventType;
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
+import de.ugoe.cs.autoquest.test.DummyGUIElement;
+import de.ugoe.cs.autoquest.test.DummyInteraction;
+
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 28.04.2012$
+ * @author 2012, last modified by $Author: patrick$
+ */
+public class IterationOfSubtreesDetectionRuleTest extends AbstractTemporalRelationshipTC {
+
+    /**
+     *
+     */
+    @Test
+    public void testInteractionIterationDetection() throws Exception {
+        IEventTarget element1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        simulateEvent(event1, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Event bla {}" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        simulateEvent(event1, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        simulateEvent(event1, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        for (int i = 0; i < 10; i++) {
+            simulateEvent(event1, element1);
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        // now test with preceding and trailing other events
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
+
+        simulateEvent(event2, element1);
+        simulateEvent(event3, element1);
+        for (int i = 0; i < 10; i++) {
+            simulateEvent(event1, element1);
+        }
+        simulateEvent(event3, element1);
+        simulateEvent(event2, element1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event bli {}" +
+             "  Event blup {}" +
+             "  Iteration iteration2 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event blup {}" +
+             "  Event bli {}" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        // now test with iterations of iterations
+
+        for (int i = 0; i < 10; i++) {
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event1, element1);
+            }
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event2, element1);
+            }
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event3, element1);
+            }
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event bli {}" +
+             "  Event blup {}" +
+             "  Iteration iteration2 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event blup {}" +
+             "  Event bli {}" +
+             "  Iteration iteration3 {" +
+             "    Sequence sequence2 {" +
+             "      Iteration iteration4 {" +
+             "        Event bla {}" +
+             "      }" +
+             "      Iteration iteration5 {" +
+             "        Event bli {}" +
+             "      }" +
+             "      Iteration iteration6 {" +
+             "        Event blup {}" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testSequenceIterationDetection() throws Exception {
+        IEventTarget element1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
+        simulateEvent(event1, element1);
+        simulateEvent(event2, element1);
+        simulateEvent(event3, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Event bla {}" +
+             "  Event bli {}" +
+             "  Event blup {}" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        simulateEvent(event1, element1);
+        simulateEvent(event2, element1);
+        simulateEvent(event3, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Sequence sequence2 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        simulateEvent(event1, element1);
+        simulateEvent(event2, element1);
+        simulateEvent(event3, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Sequence sequence2 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        for (int i = 0; i < 10; i++) {
+            simulateEvent(event1, element1);
+            simulateEvent(event2, element1);
+            simulateEvent(event3, element1);
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Sequence sequence2 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        // now test with preceding and trailing other events
+        IEventType event4 = new DummyInteraction("ble", 1);
+        IEventType event5 = new DummyInteraction("blo", 1);
+        IEventType event6 = new DummyInteraction("blu", 1);
+        simulateEvent(event4, element1);
+        simulateEvent(event5, element1);
+        simulateEvent(event6, element1);
+        for (int i = 0; i < 10; i++) {
+            simulateEvent(event1, element1);
+            simulateEvent(event2, element1);
+            simulateEvent(event3, element1);
+        }
+        simulateEvent(event6, element1);
+        simulateEvent(event5, element1);
+        simulateEvent(event4, element1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Sequence sequence2 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "  Event ble {}" +
+             "  Event blo {}" +
+             "  Event blu {}" +
+             "  Iteration iteration2 {" +
+             "    Sequence sequence3 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "  Event blu {}" +
+             "  Event blo {}" +
+             "  Event ble {}" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+
+        // now test with iterations of iterations
+        for (int i = 0; i < 10; i++) {
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event1, element1);
+                simulateEvent(event2, element1);
+                simulateEvent(event3, element1);
+            }
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event2, element1);
+                simulateEvent(event1, element1);
+                simulateEvent(event3, element1);
+            }
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event1, element1);
+                simulateEvent(event2, element1);
+                simulateEvent(event3, element1);
+            }
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Sequence sequence2 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "  Event ble {}" +
+             "  Event blo {}" +
+             "  Event blu {}" +
+             "  Iteration iteration2 {" +
+             "    Sequence sequence3 {" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event blup {}" +
+             "    }" +
+             "  }" +
+             "  Event blu {}" +
+             "  Event blo {}" +
+             "  Event ble {}" +
+             "  Iteration iteration3 {" +
+             "    Sequence sequence4 {" +
+             "      Iteration iteration4 {" +
+             "        Sequence sequence4 {" +
+             "          Event bla {}" +
+             "          Event bli {}" +
+             "          Event blup {}" +
+             "        }" +
+             "      }" +
+             "      Iteration iteration5 {" +
+             "        Sequence sequence5 {" +
+             "          Event bli {}" +
+             "          Event bla {}" +
+             "          Event blup {}" +
+             "        }" +
+             "      }" +
+             "      Iteration iteration6 {" +
+             "        Sequence sequence6 {" +
+             "          Event bla {}" +
+             "          Event bli {}" +
+             "          Event blup {}" +
+             "        }" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "}", getTaskTree(IterationOfSubtreesDetectionRule.class, null));
+    }
+
+}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceDependingOnEventTypeDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceDependingOnEventTypeDetectionRuleTest.java	(revision 1127)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceDependingOnEventTypeDetectionRuleTest.java	(revision 1127)
@@ -0,0 +1,347 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement;
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
+import de.ugoe.cs.autoquest.test.DummyGUIElement;
+import de.ugoe.cs.autoquest.test.DummyInteraction;
+
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: $
+ * @author 2011, last modified by $Author: $
+ */
+public class SequenceDependingOnEventTypeDetectionRuleTest extends AbstractTemporalRelationshipTC {
+    
+    /**
+     *
+     */
+    @Test
+    public void test_01() {
+        IGUIElement elem1 = new DummyGUIElement("elem1");
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence {" +
+             "  Event start {}" +
+             "  Event end {}" +
+             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null));
+    }
+    
+    
+    /**
+     *
+     */
+    @Test
+    public void test_02() {
+        IGUIElement elem1 = new DummyGUIElement("elem1");
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence {" +
+             "  Event start {}" +
+             "  Event bla {}" +
+             "  Event end {}" +
+             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null));
+    }
+    
+    /**
+     *
+     */
+    @Test
+    public void test_03() {
+        IGUIElement elem1 = new DummyGUIElement("elem1");
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new DummyInteraction("blup", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("end", 1), elem1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Event start {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blup {}" +
+             "    Event end {}" +
+             "  }" +
+             "  Sequence sequence2 {" +
+             "    Event start {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event end {}" +
+             "  }" +
+             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null));
+    }
+    
+    /**
+     *
+     */
+    @Test
+    public void test_04() {
+        IGUIElement elem1 = new DummyGUIElement("elem1");
+        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new DummyInteraction("blup", 1), elem1);
+        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Event startFinish {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blup {}" +
+             "  }" +
+             "  Sequence sequence2 {" +
+             "    Event startFinish {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "  }" +
+             "  Event startFinish {}" +
+             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_05() {
+        IGUIElement elem1 = new DummyGUIElement("elem1");
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new DummyInteraction("blup", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("blup", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Event start {}" +
+             "    Event bla {}" +
+             "    Sequence sequence2 {" +
+             "      Event start {}" +
+             "      Sequence sequence3 {" +
+             "        Event start {}" +
+             "        Event bli {}" +
+             "        Event blup {}" +
+             "        Event finish {}" +
+             "      }" +
+             "      Event bla {}" +
+             "      Event bli {}" +
+             "      Event finish {}" +
+             "    }" +
+             "    Sequence sequence4 {" +
+             "      Event start {}" +
+             "      Sequence sequence5 {" +
+             "        Event start {}" +
+             "        Sequence sequence6 {" +
+             "          Event start {}" +
+             "          Event blup {}" +
+             "          Event finish {}" +
+             "        }" +
+             "        Event finish {}" +
+             "      }" +
+             "      Event finish {}" +
+             "    }" +
+             "    Event finish {}" +
+             "  }" +
+             "  Event finish {}" +
+             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void test_06() {
+        IGUIElement elem1 = new DummyGUIElement("elem1");
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new DummyInteraction("blup", 1), elem1);
+        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
+        simulateEvent(new DummyInteraction("bla", 1), elem1);
+        simulateEvent(new DummyInteraction("bli", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new StartSequenceInteraction("start", 1), elem1);
+        simulateEvent(new DummyInteraction("blup", 1), elem1);
+        simulateEvent(new StartAndFinishSequenceInteraction("startFinish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+        simulateEvent(new FinishSequenceInteraction("finish", 1), elem1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Event start {}" +
+             "    Event bla {}" +
+             "    Sequence sequence2 {" +
+             "      Event start {}" +
+             "      Sequence sequence3 {" +
+             "        Event start {}" +
+             "        Event bli {}" +
+             "        Event blup {}" +
+             "      }" +
+             "      Sequence sequence4 {" +
+             "        Event startFinish {}" +
+             "        Event bla {}" +
+             "        Event bli {}" +
+             "        Event finish {}" +
+             "      }" +
+             "      Sequence sequence5 {" +
+             "        Event start {}" +
+             "        Sequence sequence6 {" +
+             "          Event start {}" +
+             "          Sequence sequence7 {" +
+             "            Event start {}" +
+             "            Event blup {}" +
+             "          }" +
+             "          Sequence sequence8 {" +
+             "            Event startFinish {}" +
+             "            Event finish {}" +
+             "          }" +
+             "          Event finish {}" +
+             "        }" +
+             "        Event finish {}" +
+             "      }" +
+             "      Event finish {}" +
+             "    }" +
+             "    Event finish {}" +
+             "  }" +
+             "  Event finish {}" +
+             "}", getTaskTree(SequenceDependingOnEventTypeDetectionRule.class, null));
+    }
+    
+    /**
+     *
+     */
+    private class StartSequenceInteraction extends DummyInteraction {
+
+        /**  */
+        private static final long serialVersionUID = 1L;
+
+        /**
+         *
+         */
+        public StartSequenceInteraction(String interactionType, int interactionNumber) {
+            super(interactionType, interactionNumber);
+        }
+
+        /* (non-Javadoc)
+         * @see de.ugoe.cs.autoquest.test.DummyInteraction#startsLogicalSequence()
+         */
+        @Override
+        public boolean startsLogicalSequence() {
+            return true;
+        }
+        
+    }
+
+    /**
+     *
+     */
+    private class FinishSequenceInteraction extends DummyInteraction {
+
+        /**  */
+        private static final long serialVersionUID = 1L;
+
+        /**
+         *
+         */
+        public FinishSequenceInteraction(String interactionType, int interactionNumber) {
+            super(interactionType, interactionNumber);
+        }
+ 
+        /* (non-Javadoc)
+         * @see de.ugoe.cs.autoquest.test.DummyInteraction#finishesLogicalSequence()
+         */
+        @Override
+        public boolean finishesLogicalSequence() {
+            return true;
+        }
+       
+    }
+
+    /**
+     *
+     */
+    private class StartAndFinishSequenceInteraction extends DummyInteraction {
+
+        /**  */
+        private static final long serialVersionUID = 1L;
+
+        /**
+         *
+         */
+        public StartAndFinishSequenceInteraction(String interactionType, int interactionNumber) {
+            super(interactionType, interactionNumber);
+        }
+ 
+        /* (non-Javadoc)
+         * @see de.ugoe.cs.autoquest.test.DummyInteraction#startsLogicalSequence()
+         */
+        @Override
+        public boolean startsLogicalSequence() {
+            return true;
+        }
+        
+        /* (non-Javadoc)
+         * @see de.ugoe.cs.autoquest.test.DummyInteraction#finishesLogicalSequence()
+         */
+        @Override
+        public boolean finishesLogicalSequence() {
+            return true;
+        }
+       
+    }
+}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java	(revision 1127)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceForTaskDetectionRuleTest.java	(revision 1127)
@@ -0,0 +1,103 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+import de.ugoe.cs.autoquest.eventcore.gui.IInteraction;
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
+import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality;
+import de.ugoe.cs.autoquest.test.DummyGUIElement;
+import de.ugoe.cs.autoquest.test.DummyInteraction;
+
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 28.04.2012$
+ * @author 2012, last modified by $Author: patrick$
+ */
+public class SequenceForTaskDetectionRuleTest extends AbstractTemporalRelationshipTC {
+
+    /**
+     *
+     */
+    @Test
+    public void testTaskDetection() throws Exception {
+        IEventTarget element1 = new DummyGUIElement("elem1");
+        
+        IInteraction action1 = new DummyInteraction("action1", 1);
+        IInteraction action2 = new DummyInteraction("action2", 1);
+        IInteraction action3 = new DummyInteraction("action3", 1);
+        IInteraction action4 = new DummyInteraction("action4", 1);
+        
+        simulateEvent(new DummyInteraction("noise0", 1), element1);
+        simulateEvent(action1, element1);
+        simulateEvent(action2, element1);
+        simulateEvent(action3, element1);
+        simulateEvent(action4, element1);
+        simulateEvent(new DummyInteraction("noise1", 1), element1);
+        simulateEvent(new DummyInteraction("noise2", 1), element1);
+        simulateEvent(action1, element1);
+        simulateEvent(action2, element1);
+        simulateEvent(action3, element1);
+        simulateEvent(action4, element1);
+        simulateEvent(new DummyInteraction("noise3", 1), element1);
+        simulateEvent(new DummyInteraction("noise4", 1), element1);
+        simulateEvent(new DummyInteraction("noise5", 1), element1);
+        simulateEvent(new DummyInteraction("noise6", 1), element1);
+        simulateEvent(action1, element1);
+        simulateEvent(action2, element1);
+        simulateEvent(action3, element1);
+        simulateEvent(action4, element1);
+        simulateEvent(new DummyInteraction("noise7", 1), element1);
+        simulateEvent(new DummyInteraction("noise8", 1), element1);
+        
+        new TaskTreeChecker(true).assertTaskTree
+            ("Sequence root {" +
+             "  Sequence session1 {" +
+             "    Event noise0 {}" +
+             "    Sequence sequence2 {" +
+             "      Event action1 {}" +
+             "      Event action2 {}" +
+             "      Event action3 {}" +
+             "      Event action4 {}" +
+             "    }" +
+             "    Event noise1 {}" +
+             "    Event noise2 {}" +
+             "    Sequence sequence2 {" +
+             "      Event action1 {}" +
+             "      Event action2 {}" +
+             "      Event action3 {}" +
+             "      Event action4 {}" +
+             "    }" +
+             "    Event noise3 {}" +
+             "    Event noise4 {}" +
+             "    Event noise5 {}" +
+             "    Event noise6 {}" +
+             "    Sequence sequence2 {" +
+             "      Event action1 {}" +
+             "      Event action2 {}" +
+             "      Event action3 {}" +
+             "      Event action4 {}" +
+             "    }" +
+             "    Event noise7 {}" +
+             "    Event noise8 {}" +
+             "  }" +
+             "}", getTaskTree(SequenceForTaskDetectionRule.class, NodeEquality.LEXICALLY_EQUAL));
+
+    }
+
+}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnGuiElementDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnGuiElementDetectionRuleTest.java	(revision 1127)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SequenceOnGuiElementDetectionRuleTest.java	(revision 1127)
@@ -0,0 +1,238 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
+import de.ugoe.cs.autoquest.test.DummyGUIElement;
+import de.ugoe.cs.autoquest.test.DummyInteraction;
+
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: $
+ * @author 2011, last modified by $Author: $
+ */
+public class SequenceOnGuiElementDetectionRuleTest extends AbstractTemporalRelationshipTC {
+    
+    /**
+     *
+     */
+    @Test
+    public void testOneInteractionOnOneElement() {
+        simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1"));
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence {" +
+             "  Event bla {}" +
+             "}", getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testManyInteractionsOnOneElement() {
+        IEventTarget eventTarget = new DummyGUIElement("elem1");
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget);
+        simulateEvent(new DummyInteraction("blo", 1), eventTarget);
+        simulateEvent(new DummyInteraction("blu", 1), eventTarget);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence {" +
+             "  Event bla {}" +
+             "  Event bli {}" +
+             "  Event blo {}" +
+             "  Event blu {}" +
+             "  Event bla {}" +
+             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testOneInteractionOnManyElements() {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
+        IEventTarget eventTarget3 = new DummyGUIElement("elem3");
+        IEventTarget eventTarget4 = new DummyGUIElement("elem4");
+        IEventTarget eventTarget5 = new DummyGUIElement("elem5");
+        IEventTarget eventTarget6 = new DummyGUIElement("elem6");
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget2);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget3);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
+        simulateEvent(new DummyInteraction("blo", 1), eventTarget5);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget6);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Sequence sequence2 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Sequence sequence3 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Sequence sequence4 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Sequence sequence5 {" +
+             "    Event blo {}" +
+             "  }" +
+             "  Sequence sequence6 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testManyInteractionsOnManyElementsWithoutHierarchy() {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventTarget eventTarget2 = new DummyGUIElement("elem2");
+        IEventTarget eventTarget3 = new DummyGUIElement("elem3");
+        IEventTarget eventTarget4 = new DummyGUIElement("elem4");
+        IEventTarget eventTarget5 = new DummyGUIElement("elem5");
+        IEventTarget eventTarget6 = new DummyGUIElement("elem6");
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget1);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget1);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget2);
+        simulateEvent(new DummyInteraction("blo", 1), eventTarget2);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget3);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget4);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget4);
+        simulateEvent(new DummyInteraction("blo", 1), eventTarget4);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget5);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget6);
+        simulateEvent(new DummyInteraction("bla", 1), eventTarget6);
+        simulateEvent(new DummyInteraction("bli", 1), eventTarget6);
+        simulateEvent(new DummyInteraction("blo", 1), eventTarget6);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "  }" +
+             "  Sequence sequence2 {" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "  }" +
+             "  Sequence sequence3 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Sequence sequence4 {" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "  }" +
+             "  Sequence sequence5 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Sequence sequence6 {" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "  }" +
+             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null));
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testManyInteractionsOnManyElementsWithHierarchy() {
+        DummyGUIElement parentA = new DummyGUIElement("A");
+        DummyGUIElement parentB = new DummyGUIElement("B", parentA);
+        DummyGUIElement parentC = new DummyGUIElement("C", parentB);
+        DummyGUIElement parentF = new DummyGUIElement("F", parentB);
+        DummyGUIElement parentH = new DummyGUIElement("H", parentA);
+        DummyGUIElement parentI = new DummyGUIElement("I", parentH);
+        
+        DummyGUIElement eventTargetD = new DummyGUIElement("D", parentC);
+        DummyGUIElement eventTargetE = new DummyGUIElement("E", parentC);
+        DummyGUIElement eventTargetG = new DummyGUIElement("G", parentF);
+        DummyGUIElement eventTargetJ = new DummyGUIElement("J", parentI);
+        
+        simulateEvent(new DummyInteraction("1", 1), eventTargetD);
+        simulateEvent(new DummyInteraction("2", 1), eventTargetD);
+        simulateEvent(new DummyInteraction("3", 1), eventTargetE);
+        simulateEvent(new DummyInteraction("4", 1), eventTargetD);
+        simulateEvent(new DummyInteraction("5", 1), eventTargetG);
+        simulateEvent(new DummyInteraction("6", 1), eventTargetG);
+        simulateEvent(new DummyInteraction("7", 1), eventTargetD);
+        simulateEvent(new DummyInteraction("8", 1), eventTargetJ);
+        simulateEvent(new DummyInteraction("9", 1), eventTargetG);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence0 {" +
+             "  Sequence sequence1 {" +
+             "    Sequence sequence2 {" +
+             "      Sequence sequence3 {" +
+             "        Event 1 {}" +
+             "        Event 2 {}" +
+             "      }" +
+             "      Sequence sequence4 {" +
+             "        Event 3 {}" +
+             "      }" +
+             "      Sequence sequence5 {" +
+             "        Event 4 {}" +
+             "      }" +
+             "    }" +
+             "    Sequence sequence6 {" +
+             "      Sequence sequence7 {" +
+             "        Event 5 {}" +
+             "        Event 6 {}" +
+             "      }" +
+             "    }" +
+             "    Sequence sequence8 {" +
+             "      Sequence sequence9 {" +
+             "        Event 7 {}" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "  Sequence sequence10 {" +
+             "    Sequence sequence11 {" +
+             "      Sequence sequence12 {" +
+             "        Event 8 {}" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "  Sequence sequence13 {" +
+             "    Sequence sequence14 {" +
+             "      Sequence sequence15 {" +
+             "        Event 9 {}" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "}", getTaskTree(SequenceOnGuiElementDetectionRule.class, null));
+    }
+
+}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SimpleIterationDetectionRuleTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SimpleIterationDetectionRuleTest.java	(revision 1127)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/SimpleIterationDetectionRuleTest.java	(revision 1127)
@@ -0,0 +1,174 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.eventcore.IEventTarget;
+import de.ugoe.cs.autoquest.eventcore.IEventType;
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
+import de.ugoe.cs.autoquest.test.DummyGUIElement;
+import de.ugoe.cs.autoquest.test.DummyInteraction;
+
+/**
+ * TODO comment
+ * 
+ * @version $Revision: $ $Date: 28.04.2012$
+ * @author 2012, last modified by $Author: patrick$
+ */
+public class SimpleIterationDetectionRuleTest extends AbstractTemporalRelationshipTC {
+
+    /**
+     *
+     */
+    @Test
+    public void testInteractionIterationDetection() throws Exception {
+        IEventTarget element1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        simulateEvent(event1, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Event bla {}" +
+             "}", getTaskTree(SimpleIterationDetectionRule.class, null));
+
+        simulateEvent(event1, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(SimpleIterationDetectionRule.class, null));
+
+        simulateEvent(event1, element1);
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(SimpleIterationDetectionRule.class, null));
+
+        for (int i = 0; i < 10; i++) {
+            simulateEvent(event1, element1);
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "}", getTaskTree(SimpleIterationDetectionRule.class, null));
+
+        // now test with preceding and trailing other events
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
+
+        simulateEvent(event2, element1);
+        simulateEvent(event3, element1);
+        for (int i = 0; i < 10; i++) {
+            simulateEvent(event1, element1);
+        }
+        simulateEvent(event3, element1);
+        simulateEvent(event2, element1);
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event bli {}" +
+             "  Event blup {}" +
+             "  Iteration iteration2 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event blup {}" +
+             "  Event bli {}" +
+             "}", getTaskTree(SimpleIterationDetectionRule.class, null));
+
+        // now test with iterations of iterations
+
+        for (int i = 0; i < 5; i++) {
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event1, element1);
+            }
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event2, element1);
+            }
+            for (int j = 0; j < 5; j++) {
+                simulateEvent(event3, element1);
+            }
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence sequence1 {" +
+             "  Iteration iteration1 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event bli {}" +
+             "  Event blup {}" +
+             "  Iteration iteration2 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Event blup {}" +
+             "  Event bli {}" +
+             "  Iteration iteration4 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Iteration iteration5 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Iteration iteration6 {" +
+             "    Event blup {}" +
+             "  }" +
+             "  Iteration iteration7 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Iteration iteration8 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Iteration iteration9 {" +
+             "    Event blup {}" +
+             "  }" +
+             "  Iteration iteration10 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Iteration iteration11 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Iteration iteration12 {" +
+             "    Event blup {}" +
+             "  }" +
+             "  Iteration iteration13 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Iteration iteration14 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Iteration iteration15 {" +
+             "    Event blup {}" +
+             "  }" +
+             "  Iteration iteration16 {" +
+             "    Event bla {}" +
+             "  }" +
+             "  Iteration iteration17 {" +
+             "    Event bli {}" +
+             "  }" +
+             "  Iteration iteration18 {" +
+             "    Event blup {}" +
+             "  }" +
+             "}", getTaskTree(SimpleIterationDetectionRule.class, null));
+
+    }
+
+}
Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskTreeNodeMergerTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskTreeNodeMergerTest.java	(revision 1127)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskTreeNodeMergerTest.java	(revision 1127)
@@ -0,0 +1,1194 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeChecker;
+import de.ugoe.cs.autoquest.tasktrees.TaskTreeInstantiator;
+import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEquality;
+import de.ugoe.cs.autoquest.tasktrees.nodeequality.NodeEqualityRuleManager;
+import de.ugoe.cs.autoquest.tasktrees.testutils.Utilities;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeBuilder;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNodeFactory;
+import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeBuilder;
+import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskTreeNodeFactory;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Patrick Harms
+ */
+public class TaskTreeNodeMergerTest {
+
+    /** */
+    private ITaskTreeBuilder taskTreeBuilder = new TaskTreeBuilder();
+
+    /** */
+    private ITaskTreeNodeFactory taskTreeNodeFactory = new TaskTreeNodeFactory();
+
+    /** */
+    private NodeEqualityRuleManager nodeEqualityRuleManager =
+        Utilities.getNodeEqualityRuleManagerForTests();
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_1() {
+        String spec1 = "EventTask target1 {}";
+        String spec2 = "EventTask target1 {}";
+        
+        String oracleSpec = "EventTask target1 {}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_2() {
+        String spec1 = "EventTask target1 {}";
+        String spec2 = "EventTask target2 {}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_3() {
+        String spec1 =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 = "EventTask target2 {}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_4() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_5() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_6() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_7() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_8() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  Sequence {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_EventTaskMerge_9() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  Optional {" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_1() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_2() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target4 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  Selection {" +
+            "    EventTask target2 {}" +
+            "    EventTask target4 {}" +
+            "  }" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_3() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target4 {}" +
+            "  EventTask target5 {}" +
+            "  EventTask target6 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "  Sequence {" +
+            "    EventTask target4 {}" +
+            "    EventTask target5 {}" +
+            "    EventTask target6 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_4() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target4 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  Selection {" +
+            "    EventTask target3 {}" +
+            "    EventTask target4 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_5() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target4 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target4 {}" +
+            "  }" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_6() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target4 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target5 {}" +
+            "}";
+
+        String oracleSpec =
+            "Sequence {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target4 {}" +
+            "  }" +
+            "  EventTask target2 {}" +
+            "  Selection {" +
+            "    EventTask target3 {}" +
+            "    EventTask target5 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_7() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  Optional {" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_8() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  Optional {" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_9() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  Optional {" +
+            "    EventTask target1 {}" +
+            "  }" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_10() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target2 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  Optional {" +
+            "    EventTask target1 {}" +
+            "  }" +
+            "  EventTask target2 {}" +
+            "  Optional {" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SequenceMerge_11() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "  EventTask target4 {}" +
+            "  EventTask target5 {}" +
+            "  EventTask target6 {}" +
+            "  EventTask target7 {}" +
+            "}";
+
+        String spec2 =
+            "Sequence {" +
+            "  EventTask target4 {}" +
+            "  EventTask target3 {}" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "  EventTask target4 {}" +
+            "  EventTask target4 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target6 {}" +
+            "  EventTask target7 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Sequence {" +
+            "  Optional {" +
+            "    Sequence {" +
+            "      EventTask target4 {}" +
+            "      EventTask target3 {}" +
+            "    }" +
+            "  }" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "  EventTask target4 {}" +
+            "  Selection {" +
+            "    EventTask target5 {}" +
+            "    Sequence {" +
+            "      EventTask target4 {}" +
+            "      EventTask target2 {}" +
+            "    }" +
+            "  }" +
+            "  EventTask target6 {}" +
+            "  EventTask target7 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SelectionMerge_1() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SelectionMerge_2() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Selection {" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "  EventTask target3 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SelectionMerge_3() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  EventTask target1 {}" +
+            "  Sequence {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_SelectionMerge_4() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    Optional {" +
+            "      EventTask target2 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_SelectionMerge_5() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_SelectionMerge_6() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target3 {}" +
+            "    EventTask target4 {}" +
+            "  }" +
+            "  Sequence {" +
+            "    EventTask target5 {}" +
+            "    EventTask target6 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Selection {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "  Sequence {" +
+            "    EventTask target3 {}" +
+            "    EventTask target4 {}" +
+            "  }" +
+            "  Sequence {" +
+            "    EventTask target5 {}" +
+            "    EventTask target6 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_IterationMerge_1() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_IterationMerge_2() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_IterationMerge_3() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  Sequence {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    Sequence {" +
+            "      EventTask target2 {}" +
+            "      EventTask target3 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_IterationMerge_4() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Iteration {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    Optional {" +
+            "      EventTask target2 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_IterationMerge_5() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 =
+            "Iteration {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_IterationMerge_6() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 =
+            "Iteration {" +
+            "  Selection {" +
+            "    Sequence {" +
+            "      EventTask target3 {}" +
+            "      EventTask target4 {}" +
+            "    }" +
+            "    Sequence {" +
+            "      EventTask target5 {}" +
+            "      EventTask target6 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Iteration {" +
+            "  Selection {" +
+            "    Sequence {" +
+            "      EventTask target1 {}" +
+            "      EventTask target2 {}" +
+            "    }" +
+            "    Sequence {" +
+            "      EventTask target3 {}" +
+            "      EventTask target4 {}" +
+            "    }" +
+            "    Sequence {" +
+            "      EventTask target5 {}" +
+            "      EventTask target6 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_OptionalMerge_1() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Optional {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        String oracleSpec =
+            "Optional {" +
+            "  EventTask target1 {}" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_OptionalMerge_2() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Optional {" +
+            "  Selection {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Optional {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_OptionalMerge_3() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Optional {" +
+            "  Sequence {" +
+            "    EventTask target2 {}" +
+            "    EventTask target3 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Optional {" +
+            "  Selection {" +
+            "    EventTask target1 {}" +
+            "    Sequence {" +
+            "      EventTask target2 {}" +
+            "      EventTask target3 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_OptionalMerge_4() {
+        String spec1 = "EventTask target1 {}";
+        
+        String spec2 =
+            "Optional {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Optional {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    Optional {" +
+            "      EventTask target2 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+
+    /**
+     * 
+     */
+    @Test
+    public void test_OptionalMerge_5() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 =
+            "Optional {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Optional {" +
+            "  Sequence {" +
+            "    EventTask target1 {}" +
+            "    EventTask target2 {}" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    @Test
+    public void test_OptionalMerge_6() {
+        String spec1 =
+            "Sequence {" +
+            "  EventTask target1 {}" +
+            "  EventTask target2 {}" +
+            "}";
+
+        String spec2 =
+            "Optional {" +
+            "  Selection {" +
+            "    Sequence {" +
+            "      EventTask target3 {}" +
+            "      EventTask target4 {}" +
+            "    }" +
+            "    Sequence {" +
+            "      EventTask target5 {}" +
+            "      EventTask target6 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        String oracleSpec =
+            "Optional {" +
+            "  Selection {" +
+            "    Sequence {" +
+            "      EventTask target1 {}" +
+            "      EventTask target2 {}" +
+            "    }" +
+            "    Sequence {" +
+            "      EventTask target3 {}" +
+            "      EventTask target4 {}" +
+            "    }" +
+            "    Sequence {" +
+            "      EventTask target5 {}" +
+            "      EventTask target6 {}" +
+            "    }" +
+            "  }" +
+            "}";
+        
+        performTest(spec1, spec2, oracleSpec);
+    }
+    
+    /**
+     * 
+     */
+    private void performTest(String spec1, String spec2, String specOracle) {
+        TaskTreeInstantiator instantiator =
+                new TaskTreeInstantiator(taskTreeNodeFactory, taskTreeBuilder);
+            
+        ITaskTreeNode node1 = instantiator.instantiateTaskTree(spec1);
+        ITaskTreeNode node2 = instantiator.instantiateTaskTree(spec2);
+        ITaskTreeNode oracle = instantiator.instantiateTaskTree(specOracle);
+        
+        TaskTreeNodeComparator comparator =
+            new TaskTreeNodeComparator(nodeEqualityRuleManager, NodeEquality.LEXICALLY_EQUAL);
+        
+        TaskTreeNodeMerger merger = new TaskTreeNodeMerger
+            (taskTreeNodeFactory, taskTreeBuilder, comparator);
+        
+        try {
+            ITaskTreeNode result = merger.mergeTaskNodes(node1, node2);
+            new TaskTreeChecker().assertTaskNodesEqual(oracle, result);
+        }
+        catch (AssertionError e) {
+            AssertionError toThrow = new AssertionError("first check: " + e.getMessage());
+            toThrow.setStackTrace(e.getStackTrace());
+            throw toThrow;
+        }
+        
+        node1 = instantiator.instantiateTaskTree(spec1);
+        node2 = instantiator.instantiateTaskTree(spec2);
+        oracle = instantiator.instantiateTaskTree(specOracle);
+        
+        comparator =
+            new TaskTreeNodeComparator(nodeEqualityRuleManager, NodeEquality.LEXICALLY_EQUAL);
+        
+        merger = new TaskTreeNodeMerger(taskTreeNodeFactory, taskTreeBuilder, comparator);
+            
+        try {
+            ITaskTreeNode result = merger.mergeTaskNodes(node2, node1);
+            new TaskTreeChecker().assertTaskNodesEqual(oracle, result);
+        }
+        catch (AssertionError e) {
+            AssertionError toThrow = new AssertionError("second check: " + e.getMessage());
+            toThrow.setStackTrace(e.getStackTrace());
+            throw toThrow;
+        }
+    }
+}
