Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithEventTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithEventTest.java	(revision 1152)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithEventTest.java	(revision 1171)
@@ -16,6 +16,4 @@
 
 import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
-import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.ITERATION;
-import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SELECTION;
 import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTypeFilter.SEQUENCE;
 import static org.fest.assertions.api.Assertions.assertThat;
@@ -23,8 +21,8 @@
 import org.junit.Test;
 
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern;
 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternBuilder;
-import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil;
+import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskModelUtil;
 
 /**
@@ -36,12 +34,22 @@
  */
 public class EndsWithEventTest {
-
+    
     @Test
-    public void sequence_ends_with_positive_1() {
+    public void ends_with_event_positive() {
         // Given
-        String spec = "Sequence {" + 
-                      "  TextInput () {}" + 
+        String spec = "UserSession {" +
+        		      "  Selection sel1 {" +
+        		      "    Sequence seq1 {" +
+                      "      EventTask target1 {}" +
+                      "    }" +
+                      "  }" +
+                      "  Selection sel1 {" +
+                      "    Sequence seq2 {" +
+                      "      EventTask target2 {}" +
+                      "      TextInput target3 {}" +
+                      "    }" +
+                      "  }" +
                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        ITaskModel taskTree = GenerateTaskModelUtil.getTaskModelFromSpec(spec);
         UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
         // When
@@ -52,318 +60,28 @@
     
     @Test
-    public void sequence_ends_with_positive_2() {
+    public void ends_with_event_negative() {
         // Given
-        String spec = "Selection {" +
-                      "  EventTask target1 {}" +
-                      "  Sequence {" +
-                      "    EventTask target2 {}" +
-                      "    TextInput target3 {}" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void sequence_ends_with_positive_3() {
-        // Given
-        String spec =  "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 {}" +
-                       "  TextInput target7 {}" +
-                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-   
-    @Test
-    public void sequence_ends_with_negative_1() {
-        // Given
-        String spec = "Sequence {" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void sequence_ends_with_negative_2() {
-        // Given
-        String spec = "Selection {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    EventTask target2 {}" +
-                      "  }" +
-                      "  Sequence {" +
-                      "    EventTask target3 {}" +
-                      "    EventTask target4 {}" +
-                      "  }" +
-                      "  Sequence {" +
-                      "    EventTask target5 {}" +
-                      "    EventTask target6 {}" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void sequence_ends_with_negative_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    EventTask target2 {}" +
-                      "    EventTask target3 {}" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_ends_with_positive_1() {
-        // Given
-        String spec = "Iteration {" + 
-                      "  TextInput () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_ends_with_positive_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    Selection {" +
-                      "      EventTask target2 {}" +
-                      "      TextInput target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_ends_with_positive_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    TextInput target1 {}" +
-                      "    Sequence {" +
-                      "      EventTask target2 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_ends_with_negative_1() {
-        // Given
-        String spec = "Iteration {" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_ends_with_negative_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    Optional {" +
+        String spec = "UserSession {" +
+        		      "  Selection sel1 {" +
+                      "    Sequence seq1 {" +
+                      "      EventTask target1 {}" +
                       "      EventTask target2 {}" +
                       "    }" +
                       "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_ends_with_negative_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    EventTask target1 {}" +
-                      "    Sequence {" +
-                      "      EventTask target2 {}" +
+                      "  Selection sel1 {" +
+                      "    Sequence seq2 {" +
                       "      EventTask target3 {}" +
+                      "      EventTask target4 {}" +
                       "    }" +
                       "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void selection_ends_with_positive_1() {
-        // Given
-        String spec = "Selection {" + 
-                      "  MouseClick () {}" + 
-                      "  TextInput () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_ends_with_positive_2() {
-        // Given
-        String spec = "Sequence {" +
-                      "  Optional {" +
-                      "    Sequence {" +
-                      "      EventTask target4 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "  EventTask target1 {}" +
-                      "  EventTask target2 {}" +
-                      "  EventTask target3 {}" +
-                      "  EventTask target4 {}" +
-                      "  Selection {" +
-                      "    EventTask target5 {}" +
-                      "    Sequence {" +
-                      "      EventTask target4 {}" +
-                      "      TextInput target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "  EventTask target6 {}" +
-                      "  EventTask target7 {}" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_ends_with_positive_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      EventTask target3 {}" +
-                      "      TextInput target4 {}" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      TextInput target5 {}" +
+                      "  Selection sel1 {" +
+                      "    Sequence seq3 {" +
+                      "      EventTask target5 {}" +
                       "      EventTask target6 {}" +
                       "    }" +
                       "  }" +
                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_ends_with_negative_1() {
-        // Given
-        String spec = "Selection {" + 
-                      "  DragAndDrop () {}" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).endsWith(TEXT_INPUT).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void selection_ends_with_negative_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      TextInput target3 {}" +
-                      "      EventTask target4 {}" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      TextInput target5 {}" +
-                      "      EventTask target6 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).endsWith(TEXT_INPUT).build();
+        ITaskModel taskTree = GenerateTaskModelUtil.getTaskModelFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).endsWith(TEXT_INPUT).build();
         // When
         boolean patternContained = pattern.containedIn(taskTree);
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithPatternTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithPatternTest.java	(revision 1152)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithPatternTest.java	(revision 1171)
@@ -24,8 +24,8 @@
 import org.junit.Test;
 
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel;
 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePattern;
 import de.ugoe.cs.autoquest.usability.rules.patterns.UsagePatternBuilder;
-import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil;
+import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskModelUtil;
 
 /**
@@ -39,21 +39,25 @@
 
     @Test
-    public void sequence_starts_with_positive_1() {
+    public void starts_with_pattern_positive() {
         // Given
-        String spec = "Sequence {" +
-                      "  EventTask target2 {}" +
-                      "  EventTask target3 {}" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      TextInput target4 {}" +
-                      "      MouseClick target2 {}" +
+        String spec = "UserSession {" +
+        		      "  Sequence seq1 {" +
+                      "    EventTask target2 {}" +
+                      "    EventTask target3 {}" +
+                      "    Selection sel1 {" +
+                      "      Sequence seq2 {" +
+                      "        TextInput target4 {}" +
+                      "        MouseClick target2 {}" +
+                      "      }" +
                       "    }" +
-                      "    Sequence {" +
-                      "      TextInput target4 {}" +
-                      "      EventTask target2 {}" +
+                      "    Selection sel1 {" +
+                      "      Sequence seq3 {" +
+                      "        TextInput target4 {}" +
+                      "        EventTask target2 {}" +
+                      "      }" +
                       "    }" +
                       "  }" +
                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        ITaskModel taskTree = GenerateTaskModelUtil.getTaskModelFromSpec(spec);
         UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
         UsagePattern endsWithPattern = patternBuilder.concernedNode(SELECTION).startsWith(TEXT_INPUT).endsWith(MOUSE_CLICK).build();
@@ -66,97 +70,30 @@
     
     @Test
-    public void sequence_starts_with_positive_2() {
+    public void starts_with_pattern_negative() {
         // Given
-        String spec = "Selection {" +
-                      "  EventTask target1 {}" +
-                      "  Sequence {" +
-                      "    Iteration {" +
-                      "      Sequence {" +
-                      "        TextInput target4 {}" +
-                      "        MouseClick target2 {}" +
-                      "        TextInput target4 {}" +
+        String spec = "UserSession {" +
+        		      "  Selection sel1 {" +
+                      "    Sequence seq1 {" +
+                      "      EventTask target1 {}" +
+                      "      EventTask target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "  Selection sel1 {" +
+                      "    Iteration it1 {" +
+                      "      Sequence seq2 {" +
+                      "        MouseClick target5 {}" +
+                      "        EventTask target4 {}" +
+                      "        EventTask target2 {}" +
                       "      }" +
                       "    }" +
                       "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(ITERATION).startsWith(TEXT_INPUT).contains(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SEQUENCE).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void sequence_starts_with_positive_3() {
-        // Given
-        String spec =  "Sequence {" +
-                       "  Optional {" +
-                       "    Sequence {" +
-                       "      EventTask target4 {}" +
-                       "      EventTask target3 {}" +
-                       "    }" +
-                       "  }" +
-                       "  EventTask target1 {}" +
-                       "  EventTask target2 {}" +
-                       "  EventTask target3 {}" +
-                       "  EventTask target4 {}" +
-                       "  EventTask target6 {}" +
-                       "  EventTask target7 {}" +
-                       "  Sequence {" +
-                       "    MouseClick target5 {}" +
-                       "    TextInput target4 {}" +
-                       "    MouseClick target2 {}" +
-                       "  }" +
-                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec); 
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern startsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SEQUENCE).startsWith(startsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-   
-    @Test
-    public void sequence_starts_with_negative_1() {
-        // Given
-        String spec = "Sequence {" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SELECTION).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SEQUENCE).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void sequence_starts_with_negative_2() {
-        // Given
-        String spec = "Selection {" +
-                      "  Sequence {" +
-                      "    EventTask target1 {}" +
-                      "    EventTask target2 {}" +
-                      "  }" +
-                      "  Iteration {" +
-                      "    Sequence {" +
-                      "      MouseClick target5 {}" +
-                      "      EventTask target4 {}" +
-                      "      EventTask target2 {}" +
+                      "  Selection sel1 {" +
+                      "    Sequence seq3 {" +
+                      "      EventTask target5 {}" +
+                      "      EventTask target6 {}" +
                       "    }" +
                       "  }" +
-                      "  Sequence {" +
-                      "    EventTask target5 {}" +
-                      "    EventTask target6 {}" +
-                      "  }" +
                       "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        ITaskModel taskTree = GenerateTaskModelUtil.getTaskModelFromSpec(spec);
         UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
         UsagePattern endsWithPattern = patternBuilder.concernedNode(ITERATION).startsWith(MOUSE_CLICK).contains(TEXT_INPUT).build();
@@ -168,285 +105,3 @@
     }
     
-    @Test
-    public void sequence_starts_with_negative_3() {
-        // Given
-        String spec = "Sequence {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      MouseClick target4 {}" +
-                      "      EventTask target2 {}" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      TextInput target4 {}" +
-                      "      TextInput target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(TEXT_INPUT).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SEQUENCE).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_starts_with_positive_1() {
-        // Given
-        String spec = "Iteration {" +
-        	      "  Sequence {" + 
-                      "    MouseClick () {}" +
-                      "    TextInput () {}" +
-                      "  }" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(TEXT_INPUT).build();
-        UsagePattern pattern = patternBuilder.concernedNode(ITERATION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_starts_with_positive_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      MouseClick target4 {}" +
-                      "      TextInput target2 {}" +
-                      "      MouseClick target 4 {}" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      TextInput target4 {}" +
-                      "      TextInput target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SELECTION).startsWith(MOUSE_CLICK).contains(TEXT_INPUT).build();
-        UsagePattern pattern = patternBuilder.concernedNode(ITERATION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_starts_with_positive_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    EventTask target1 {}" +
-                      "    Sequence {" +
-                      "      MouseClick target2 {}" +
-                      "      MouseClick target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(ITERATION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void iteration_starts_with_negative_1() {
-        // Given
-        String spec = "Iteration {" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(ITERATION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_starts_with_negative_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Sequence {" +
-                      "      MouseClick target2 {}" +
-                      "      MouseClick target3 {}" +
-                      "      TextInput target4 {}" + 
-                      "    }" +
-                      "    Optional {" +
-                      "      EventTask target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SELECTION).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(ITERATION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void iteration_starts_with_negative_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    EventTask target1 {}" +
-                      "    Sequence {" +
-                      "      EventTask target2 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(ITERATION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void selection_starts_with_positive_1() {
-        // Given
-        String spec = "Selection {" + 
-                      "  Sequence {" +
-                      "    MouseClick target2 {}" +
-                      "    MouseClick target3 {}" +
-                      "  }" +
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SELECTION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_starts_with_positive_2() {
-        // Given
-        String spec = "Sequence {" +
-                      "  Optional {" +
-                      "    Sequence {" +
-                      "      EventTask target4 {}" +
-                      "      EventTask target3 {}" +
-                      "    }" +
-                      "  }" +
-                      "  EventTask target1 {}" +
-                      "  EventTask target2 {}" +
-                      "  EventTask target3 {}" +
-                      "  EventTask target4 {}" +
-                      "  Selection {" +
-                      "    TextInput target5 {}" +
-                      "    Selection {" +
-                      "      MouseClick target4 {}" +
-                      "      MouseClick target2 {}" +
-                      "    }" +
-                      "  }" +
-                      "  EventTask target6 {}" +
-                      "  EventTask target7 {}" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SELECTION).startsWith(MOUSE_CLICK).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SELECTION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_starts_with_positive_3() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Iteration {" +
-                      "      Sequence {" +
-                      "        TextInput target3 {}" +
-                      "        MouseClick target4 {}" +
-                      "      }" +
-                      "    }" +
-                      "    Sequence {" +
-                      "      TextInput target5 {}" +
-                      "      EventTask target6 {}" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(ITERATION).startsWith(TEXT_INPUT).contains(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SELECTION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isTrue();
-    }
-    
-    @Test
-    public void selection_starts_with_negative_1() {
-        // Given
-        String spec = "Selection {" + 
-                      "  DragAndDrop () {}" + 
-                      "  MouseClick () {}" + 
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(SEQUENCE).startsWith(TEXT_INPUT).contains(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SELECTION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-    
-    @Test
-    public void selection_starts_with_negative_2() {
-        // Given
-        String spec = "Iteration {" +
-                      "  Selection {" +
-                      "    Iteration {" +
-                      "      Sequence {"+
-                      "        TextInput target3 {}" +
-                      "        TextInput target4 {}" +
-                      "      }" +
-                      "    }" +
-                      "    Iteration {" +
-                      "      Sequence {"+
-                      "        MouseClick target5 {}" +
-                      "        TextInput target6 {}" +
-                      "      }" +
-                      "    }" +
-                      "  }" +
-                      "}";
-        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
-        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
-        UsagePattern endsWithPattern = patternBuilder.concernedNode(ITERATION).startsWith(TEXT_INPUT).endsWith(MOUSE_CLICK).build();
-        UsagePattern pattern = patternBuilder.concernedNode(SELECTION).endsWith(endsWithPattern).build();
-        // When
-        boolean patternContained = pattern.containedIn(taskTree);
-        // Then
-        assertThat(patternContained).isFalse();
-    }
-
 }
