Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManagerTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManagerTest.java	(revision 927)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/manager/TaskTreeManagerTest.java	(revision 1132)
@@ -67,6 +67,8 @@
         simulateEvent(new DummyInteraction("bla", 1), new DummyGUIElement("elem1"));
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence {" +
-             "  Event bla {}" +
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Event bla {}" +
+             "  }" +
              "}", manager.getTaskTree());
     }
@@ -85,10 +87,12 @@
 
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence {" +
-             "  Event bla {}" +
-             "  Event bli {}" +
-             "  Event blo {}" +
-             "  Event blu {}" +
-             "  Event bla {}" +
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "    Event blu {}" +
+             "    Event bla {}" +
+             "  }" +
              "}", manager.getTaskTree());
     }
@@ -113,21 +117,11 @@
 
         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 {" +
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
              "    Event bla {}" +
              "  }" +
@@ -163,64 +157,51 @@
 
         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 {}" +
-             "  }" +
-             "}", manager.getTaskTree());
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testEventIterationDetection() throws Exception {
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event bla {}" +
+             "    Event bli {}" +
+             "    Event blo {}" +
+             "  }" +
+             "}", manager.getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testEventIterationDetection_01() throws Exception {
         IEventTarget eventTarget1 = new DummyGUIElement("elem1");
         IEventType event1 = new DummyInteraction("bla", 1);
         simulateEvent(event1, eventTarget1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Event bla {}" +
-             "}", manager.getTaskTree());
-
         simulateEvent(event1, eventTarget1);
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", manager.getTaskTree());
-
-        simulateEvent(event1, eventTarget1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", manager.getTaskTree());
-
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Iteration iteration1 {" +
+             "      Event bla {}" +
+             "    }" +
+             "  }" +
+             "}", manager.getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testEventIterationDetection_02() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
         for (int i = 0; i < 10; i++) {
             simulateEvent(event1, eventTarget1);
@@ -228,9 +209,20 @@
 
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "}", manager.getTaskTree());
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Iteration iteration1 {" +
+             "      Event bla {}" +
+             "    }" +
+             "  }" +
+             "}", manager.getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testEventIterationDetection_03() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
 
         // now test with preceding and trailing other interactions
@@ -247,19 +239,29 @@
 
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event bli {}" +
-             "  Event blup {}" +
-             "  Iteration iteration2 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event blup {}" +
-             "  Event bli {}" +
-             "}", manager.getTaskTree());
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Event bli {}" +
+             "    Event blup {}" +
+             "    Iteration iteration2 {" +
+             "      Event bla {}" +
+             "    }" +
+             "    Event blup {}" +
+             "    Event bli {}" +
+             "  }" +
+             "}", manager.getTaskTree());
+
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testEventIterationDetection_04() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
 
         // now test with iterations of iterations
-
         for (int i = 0; i < 10; i++) {
             for (int j = 0; j < 5; j++) {
@@ -275,78 +277,65 @@
 
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence0 {" +
-             "  Iteration iteration0 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event bli {}" +
-             "  Event blup {}" +
-             "  Iteration iteration1 {" +
-             "    Event bla {}" +
-             "  }" +
-             "  Event blup {}" +
-             "  Event bli {}" +
-             "  Iteration iteration2 {" +
-             "    Sequence sequence1 {" +
-             "      Iteration iteration3 {" +
-             "        Event bla {}" +
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Iteration iteration2 {" +
+             "      Sequence sequence1 {" +
+             "        Iteration iteration3 {" +
+             "          Event bla {}" +
+             "        }" +
+             "        Iteration iteration4 {" +
+             "          Event bli {}" +
+             "        }" +
+             "        Iteration iteration5 {" +
+             "          Event blup {}" +
+             "        }" +
              "      }" +
-             "      Iteration iteration4 {" +
-             "        Event bli {}" +
-             "      }" +
-             "      Iteration iteration5 {" +
-             "        Event blup {}" +
-             "      }" +
-             "    }" +
-             "  }" +
-             "}", manager.getTaskTree());
-
-    }
-
-    /**
-     *
-     */
-    @Test
-    public void testSequenceIterationDetection() throws Exception {
-        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
-        IEventType event1 = new DummyInteraction("bla", 1);
-        IEventType event2 = new DummyInteraction("bli", 1);
-        IEventType event3 = new DummyInteraction("blup", 1);
+             "    }" +
+             "  }" +
+             "}", manager.getTaskTree());
+
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testSequenceIterationDetection_01() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
+
         simulateEvent(event1, eventTarget1);
         simulateEvent(event2, eventTarget1);
         simulateEvent(event3, eventTarget1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Event bla {}" +
-             "  Event bli {}" +
-             "  Event blup {}" +
-             "}", manager.getTaskTree());
 
         simulateEvent(event1, eventTarget1);
         simulateEvent(event2, eventTarget1);
         simulateEvent(event3, eventTarget1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "}", manager.getTaskTree());
-
-        simulateEvent(event1, eventTarget1);
-        simulateEvent(event2, eventTarget1);
-        simulateEvent(event3, eventTarget1);
-        new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "}", manager.getTaskTree());
+        
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Iteration iteration1 {" +
+             "      Sequence sequence2 {" +
+             "        Event bla {}" +
+             "        Event bli {}" +
+             "        Event blup {}" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "}", manager.getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testSequenceIterationDetection_02() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
 
         for (int i = 0; i < 10; i++) {
@@ -357,18 +346,32 @@
 
         new TaskTreeChecker().assertTaskTree
-            ("Sequence sequence1 {" +
-             "  Iteration iteration1 {" +
-             "    Sequence sequence2 {" +
-             "      Event bla {}" +
-             "      Event bli {}" +
-             "      Event blup {}" +
-             "    }" +
-             "  }" +
-             "}", manager.getTaskTree());
-
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Iteration iteration1 {" +
+             "      Sequence sequence2 {" +
+             "        Event bla {}" +
+             "        Event bli {}" +
+             "        Event blup {}" +
+             "      }" +
+             "    }" +
+             "  }" +
+             "}", manager.getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testSequenceIterationDetection_03() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
+        
         // now test with preceding and trailing other interactions
         IEventType event4 = new DummyInteraction("ble", 1);
         IEventType event5 = new DummyInteraction("blo", 1);
         IEventType event6 = new DummyInteraction("blu", 1);
+        
         simulateEvent(event4, eventTarget1);
         simulateEvent(event5, eventTarget1);
@@ -384,26 +387,35 @@
 
         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 {}" +
-             "}", manager.getTaskTree());
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Event ble {}" +
+             "    Event blo {}" +
+             "    Event blu {}" +
+             "    Iteration iteration2 {" +
+             "      Sequence sequence3 {" +
+             "        Event bla {}" +
+             "        Event bli {}" +
+             "        Event blup {}" +
+             "      }" +
+             "    }" +
+             "    Event blu {}" +
+             "    Event blo {}" +
+             "    Event ble {}" +
+             "  }" +
+             "}", manager.getTaskTree());
+    }
+
+    /**
+     *
+     */
+    @Test
+    public void testSequenceIterationDetection_04() throws Exception {
+        IEventTarget eventTarget1 = new DummyGUIElement("elem1");
+        IEventType event1 = new DummyInteraction("bla", 1);
+        IEventType event2 = new DummyInteraction("bli", 1);
+        IEventType event3 = new DummyInteraction("blup", 1);
+        IEventType event4 = new DummyInteraction("blo", 1);
+        IEventType event5 = new DummyInteraction("blau", 1);
+        IEventType event6 = new DummyInteraction("blass", 1);
 
         // now test with iterations of iterations
@@ -415,58 +427,40 @@
             }
             for (int j = 0; j < 5; j++) {
-                simulateEvent(event2, eventTarget1);
+                simulateEvent(event4, eventTarget1);
+                simulateEvent(event5, eventTarget1);
+                simulateEvent(event6, eventTarget1);
+            }
+            for (int j = 0; j < 5; j++) {
                 simulateEvent(event1, eventTarget1);
                 simulateEvent(event3, eventTarget1);
-            }
-            for (int j = 0; j < 5; j++) {
-                simulateEvent(event1, eventTarget1);
-                simulateEvent(event2, eventTarget1);
-                simulateEvent(event3, eventTarget1);
-            }
-        }
-
-        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 {}" +
+                simulateEvent(event5, eventTarget1);
+            }
+        }
+
+        new TaskTreeChecker().assertTaskTree
+            ("Sequence root {" +
+             "  Sequence session {" +
+             "    Iteration iteration3 {" +
+             "      Sequence sequence4 {" +
+             "        Iteration iteration4 {" +
+             "          Sequence sequence4 {" +
+             "            Event bla {}" +
+             "            Event bli {}" +
+             "            Event blup {}" +
+             "          }" +
+             "        }" +
+             "        Iteration iteration5 {" +
+             "          Sequence sequence5 {" +
+             "            Event blo {}" +
+             "            Event blau {}" +
+             "            Event blass {}" +
+             "          }" +
+             "        }" +
+             "        Iteration iteration6 {" +
+             "          Sequence sequence6 {" +
+             "            Event bla {}" +
+             "            Event blup {}" +
+             "            Event blau {}" +
+             "          }" +
              "        }" +
              "      }" +
