Index: trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModelTest.java
===================================================================
--- trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModelTest.java	(revision 1402)
+++ trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/TaskModelTest.java	(revision 1411)
@@ -56,5 +56,5 @@
     
     /** */
-    private static final int MAX_TREE_DEPTH = 15;
+    private static final int MAX_TREE_DEPTH = 10;
 
     /** */
@@ -75,5 +75,4 @@
         
         assertNotNull(task);
-        assertNotNull(task.getDescription());
         assertNotNull(task.getId());
         assertTrue(task.equals(task));
@@ -122,5 +121,4 @@
         
         assertNotNull(task);
-        assertNotNull(task.getDescription());
         assertNotNull(task.getId());
         assertNotNull(task.getChildren());
@@ -187,5 +185,4 @@
         
         assertNotNull(task);
-        assertNotNull(task.getDescription());
         assertNotNull(task.getId());
         assertNotNull(task.getChildren());
@@ -252,5 +249,4 @@
         
         assertNotNull(task);
-        assertNotNull(task.getDescription());
         assertNotNull(task.getId());
         assertNull(task.getMarkedTask());
@@ -302,5 +298,4 @@
         
         assertNotNull(task);
-        assertNotNull(task.getDescription());
         assertNotNull(task.getId());
         assertNull(task.getMarkedTask());
@@ -381,5 +376,5 @@
      *
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test()
     public void test_SequenceInstance_01() throws Exception {
         IEventType eventType = new DummyInteraction("interaction", 1);
@@ -534,5 +529,5 @@
      *
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test()
     public void test_IterationInstance_01() throws Exception {
         IEventType eventType = new DummyInteraction("interaction", 1);
@@ -619,5 +614,5 @@
      *
      */
-    @Test(expected=IllegalArgumentException.class)
+    @Test()
     public void test_OptionalInstance_01() throws Exception {
         IEventType eventType = new DummyInteraction("interaction", 1);
@@ -801,4 +796,6 @@
             }
             
+            //new TaskTreeEncoder().encode(task, System.err);
+
             ISequenceInstance sequenceInstance =
                 (ISequenceInstance) instantiateTask(task, noOfMaxChildren);
@@ -814,4 +811,6 @@
             List<IUserSession> sessions = new LinkedList<IUserSession>();
             sessions.add(session);
+            
+            //new TaskTreeEncoder().encode(session, System.err);
             
             ITaskModel taskModel = taskFactory.createTaskModel(sessions);
@@ -853,4 +852,22 @@
             dumpMap(map1);
             dumpMap(map2);
+            
+            if (map1.size() > map2.size()) {
+                for (ITask task : map2.keySet()) {
+                    map1.remove(task);
+                }
+                
+                System.err.println("difference: ");
+                dumpMap(map1);
+            }
+            else if (map2.size() > map1.size()) {
+                for (ITask task : map1.keySet()) {
+                    map2.remove(task);
+                }
+                
+                System.err.println("difference: ");
+                dumpMap(map2);
+            }
+            
             throw e;
         }
@@ -869,11 +886,21 @@
             System.err.println("map:");
             for (Map.Entry<ITask, ITaskInfo> entry : map.entrySet()) {
+                int lineLength = 2;
                 System.err.print("  ");
                 System.err.print(entry.getKey());
-                for (int i = entry.getKey().toString().length(); i < 60; i++) {
+                lineLength += entry.getKey().toString().length();
+                for (int i = lineLength; i < 70; i++) {
+                    System.err.print(" ");
+                }
+                lineLength = 60;
+                System.err.print(" : ");
+                lineLength += 3;
+                System.err.print(entry.getValue());
+                lineLength += entry.getValue().toString().length();
+                for (int i = lineLength; i < 140; i++) {
                     System.err.print(" ");
                 }
                 System.err.print(" : ");
-                System.err.println(entry.getValue());
+                System.err.println(entry.getKey().getDescription());
             }
         }
@@ -1005,4 +1032,6 @@
         for (int i = 0; i < noOfChildren; i++) {
             ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos);
+            
+            //((Task) child).setDescription(sequence.toString());
             taskBuilder.addChild(sequence, child);
         }
@@ -1042,12 +1071,16 @@
         int noOfChildren = randomize(1, maxNoOfChildren);
         
+        Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>();
         for (int i = 0; i < noOfChildren; i++) {
             ITask child;
             do {
-                child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos);
+                childrenTaskInfos.clear();
+                child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos);
             }
             while (child instanceof ISelection);
             
+            //((Task) child).setDescription(selection.toString());
             taskBuilder.addChild(selection, child);
+            taskInfos.putAll(childrenTaskInfos);
         }
 
@@ -1083,11 +1116,15 @@
         IIteration iteration = taskFactory.createNewIteration();
 
+        Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>();
         ITask child;
         do {
-            child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos);
+            childrenTaskInfos.clear();
+            child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos);
         }
         while ((child instanceof IOptional) || (child instanceof IIteration));
         
+        //((Task) child).setDescription(iteration.toString());
         taskBuilder.setMarkedTask(iteration, child);
+        taskInfos.putAll(childrenTaskInfos);
 
         taskInfos.put(iteration, new TaskInfo(iteration));
@@ -1122,11 +1159,15 @@
         IOptional optional = taskFactory.createNewOptional();
 
+        Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>();
         ITask child;
         do {
-            child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos);
+            childrenTaskInfos.clear();
+            child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos);
         }
         while (child instanceof IOptional);
         
+        //((Task) child).setDescription(optional.toString());
         taskBuilder.setMarkedTask(optional, child);
+        taskInfos.putAll(childrenTaskInfos);
 
         taskInfos.put(optional, new TaskInfo(optional));
