Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/NoLetterOrDigitTextInputsEvaluatorTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/NoLetterOrDigitTextInputsEvaluatorTest.java	(revision 1141)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/NoLetterOrDigitTextInputsEvaluatorTest.java	(revision 1151)
@@ -48,5 +48,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(absent());
@@ -63,5 +63,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(infoRecommendationSeverityLevel());
@@ -77,5 +77,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel());
@@ -90,5 +90,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(mediumRecommendationSeverityLevel());
@@ -103,5 +103,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new NoLetterOrDigitRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(highRecommendationSeverityLevel());
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputEntryRepetitionsEvaluatorTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputEntryRepetitionsEvaluatorTest.java	(revision 1141)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputEntryRepetitionsEvaluatorTest.java	(revision 1151)
@@ -46,5 +46,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(absent());
@@ -59,5 +59,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(infoRecommendationSeverityLevel());
@@ -72,5 +72,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel());
@@ -91,5 +91,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(mediumRecommendationSeverityLevel());
@@ -110,5 +110,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputEntryRepetitionsMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(highRecommendationSeverityLevel());
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputRatioEvaluatorTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputRatioEvaluatorTest.java	(revision 1141)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/metrics/TextInputRatioEvaluatorTest.java	(revision 1151)
@@ -49,5 +49,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(absent());
@@ -62,5 +62,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(infoRecommendationSeverityLevel());
@@ -75,5 +75,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(lowRecommendationSeverityLevel());
@@ -88,5 +88,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(mediumRecommendationSeverityLevel());
@@ -99,5 +99,5 @@
         ITaskTree taskTree = createTaskTree(spec);
         // When
-        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).check();
+        Optional<UsabilityDefect> recommendation = new TextInputRatioMetric(taskTree).calculate();
         // Then
         assertThat(recommendation).is(present()).has(highRecommendationSeverityLevel());
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/AllTests.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/AllTests.java	(revision 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/AllTests.java	(revision 1151)
@@ -0,0 +1,74 @@
+//   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.usability.rules.patterns;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.contains.ContainsAndEndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.contains.ContainsEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.contains.ContainsPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.endswith.EndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.endswith.EndsWithPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsAndEndsWithEventAndContainsEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsAndEndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsAndEndsWithPatternAndContainsPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsAndEndsWithPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventAndContainsEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventAndContainsPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventAndEndsWithPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventContainsEventEndsWithPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventContainsPatternAndEndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventContainsPatternAndEndsWithPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternAndContainsEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternAndContainsPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternAndEndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternContainsEventAndEndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternContainsEventAndEndsWithPatternTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternContainsPatternAndEndsWithEventTest;
+import de.ugoe.cs.autoquest.usability.rules.patterns.visitors.startswith.StartsWithPatternTest;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+@RunWith(Suite.class)
+@SuiteClasses(
+    { 
+      StartsWithEventTest.class, StartsWithPatternTest.class,
+      StartsWithEventAndContainsEventTest.class, StartsWithPatternAndContainsPatternTest.class,
+      StartsWithEventAndContainsPatternTest.class, StartsWithPatternAndContainsEventTest.class, 
+      StartsAndEndsWithEventTest.class, StartsAndEndsWithPatternTest.class,
+      StartsWithEventAndEndsWithPatternTest.class, StartsWithPatternAndEndsWithEventTest.class,
+      StartsAndEndsWithEventAndContainsEventTest.class, StartsAndEndsWithPatternAndContainsPatternTest.class,
+      StartsWithEventContainsEventEndsWithPatternTest.class, StartsWithPatternContainsEventAndEndsWithPatternTest.class,
+      StartsWithEventContainsPatternAndEndsWithEventTest.class, StartsWithPatternContainsPatternAndEndsWithEventTest.class,
+      StartsWithEventContainsPatternAndEndsWithPatternTest.class, StartsWithPatternContainsEventAndEndsWithEventTest.class,
+      EndsWithEventTest.class, EndsWithPatternTest.class,
+      ContainsEventTest.class, ContainsPatternTest.class,
+      ContainsAndEndsWithEventTest.class
+      // E -> P
+      // P -> E
+      // P -> P
+    }
+)
+public class AllTests {
+
+}
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/LongFormUsageDefectTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/LongFormUsageDefectTest.java	(revision 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/LongFormUsageDefectTest.java	(revision 1151)
@@ -0,0 +1,86 @@
+//   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.usability.rules.patterns;
+
+import static de.ugoe.cs.autoquest.usability.testutil.FestConditionUtil.absent;
+import static de.ugoe.cs.autoquest.usability.testutil.FestConditionUtil.present;
+import static org.fest.assertions.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import com.google.common.base.Optional;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+import de.ugoe.cs.autoquest.usability.result.UsabilityDefect;
+import de.ugoe.cs.autoquest.usability.testutil.GenerateTaskTreeUtil;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+public class LongFormUsageDefectTest {
+
+    @Test
+    public void should_be_present() {
+        // Given
+        String spec = "Sequence {" +
+        	      "  Selection {" +
+        	      "     MouseClick() {}" +
+        	      "     Sequence() {" +
+        	      "       MouseClick() {}" +
+        	      "       Iteration {" +
+        	      "         Sequence {" +
+        	      "           TextInput() {}" +
+        	      "           Scroll () {}" +
+        	      "         }" +
+        	      "       }" +
+        	      "       MouseClick() {}" +
+        	      "     }" + 
+                      "  }" + 
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        // When
+        Optional<UsabilityDefect> recommendation = new LongFormUsageDefect(taskTree).check();
+        // Then
+        assertThat(recommendation).is(present());
+    }
+    
+    @Test
+    public void should_be_absent() {
+        // Given
+        String spec = "Sequence {" +
+                      "  Selection {" +
+                      "     MouseClick() {}" +
+                      "     Sequence() {" +
+                      "       MouseClick() {}" +
+                      "       TextInput() {}" +
+                      "       Iteration {" +
+                      "         Scroll () {}" +
+                      "       }" +
+                      "       MouseClick() {}" +
+                      "     }" + 
+                      "  }" + 
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        // When
+        Optional<UsabilityDefect> recommendation = new LongFormUsageDefect(taskTree).check();
+        // Then
+        assertThat(recommendation).is(absent());
+    }
+
+}
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsAndEndsWithEventTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsAndEndsWithEventTest.java	(revision 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsAndEndsWithEventTest.java	(revision 1151)
@@ -0,0 +1,375 @@
+//   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.usability.rules.patterns.visitors.contains;
+
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.MOUSE_CLICK;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.ITERATION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SELECTION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SEQUENCE;
+import static org.fest.assertions.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+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;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+public class ContainsAndEndsWithEventTest {
+
+    @Test
+    public void sequence_ends_with_positive_1() {
+        // Given
+        String spec = "Sequence {" + 
+                      "  TextInput () {}" + 
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).endsWith(TEXT_INPUT).build();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isTrue();
+    }
+    
+    @Test
+    public void sequence_ends_with_positive_2() {
+        // Given
+        String spec = "Selection {" +
+                      "  EventTask target1 {}" +
+                      "  Sequence {" +
+                      "    MouseClick target2 {}" +
+                      "    TextInput target3 {}" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(MOUSE_CLICK).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 {}" +
+                       "  MouseClick 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).contains(MOUSE_CLICK).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).contains(TEXT_INPUT).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).contains(TEXT_INPUT).endsWith(MOUSE_CLICK).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).contains(TEXT_INPUT).endsWith(MOUSE_CLICK).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).contains(TEXT_INPUT).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 {" +
+                      "    MouseClick target1 {}" +
+                      "    Selection {" +
+                      "      EventTask target2 {}" +
+                      "      TextInput target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(MOUSE_CLICK).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).contains(TEXT_INPUT).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).contains(TEXT_INPUT).endsWith(MOUSE_CLICK).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 {" +
+                      "      EventTask target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).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 {" +
+                      "      TextInput target2 {}" +
+                      "      EventTask target3 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(TEXT_INPUT).endsWith(MOUSE_CLICK).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).contains(TEXT_INPUT).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 {" +
+                      "      TextInput target4 {}" +
+                      "      TextInput target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "  EventTask target6 {}" +
+                      "  EventTask target7 {}" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).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 {}" +
+                      "      EventTask target6 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).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).contains(TEXT_INPUT).endsWith(MOUSE_CLICK).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 {" +
+                      "      EventTask target3 {}" +
+                      "      EventTask target4 {}" +
+                      "    }" +
+                      "    Sequence {" +
+                      "      EventTask target5 {}" +
+                      "      EventTask target6 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).endsWith(MOUSE_CLICK).build();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isFalse();
+    }
+
+}
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsEventTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsEventTest.java	(revision 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsEventTest.java	(revision 1151)
@@ -0,0 +1,374 @@
+//   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.usability.rules.patterns.visitors.contains;
+
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.ITERATION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SELECTION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SEQUENCE;
+import static org.fest.assertions.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+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;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+public class ContainsEventTest {
+
+    @Test
+    public void sequence_ends_with_positive_1() {
+        // Given
+        String spec = "Sequence {" + 
+                      "  TextInput () {}" + 
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(TEXT_INPUT).build();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isTrue();
+    }
+    
+    @Test
+    public void sequence_ends_with_positive_2() {
+        // Given
+        String spec = "Selection {" +
+                      "  EventTask target1 {}" +
+                      "  Sequence {" +
+                      "    EventTask target2 {}" +
+                      "    TextInput target3 {}" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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 {" +
+                      "      EventTask target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(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 {}" +
+                      "      EventTask target3 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(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).contains(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).contains(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 {}" +
+                      "      EventTask target6 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(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).contains(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 {" +
+                      "      EventTask target3 {}" +
+                      "      EventTask target4 {}" +
+                      "    }" +
+                      "    Sequence {" +
+                      "      EventTask target5 {}" +
+                      "      EventTask target6 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isFalse();
+    }
+
+}
Index: trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java
===================================================================
--- trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java	(revision 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/contains/ContainsPatternTest.java	(revision 1151)
@@ -0,0 +1,379 @@
+//   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.usability.rules.patterns.visitors.contains;
+
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.ITERATION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SELECTION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SEQUENCE;
+import static org.fest.assertions.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+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;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+public class ContainsPatternTest {
+
+    @Test
+    public void sequence_ends_with_positive_1() {
+        // Given
+        String spec = "Sequence {" +
+        	      "  Selection {" + 
+                      "    TextInput () {}" +
+                      "    MouseClick () {}" +
+                      "  }" + 
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
+        UsagePattern containsPattern = patternBuilder.concernedNode(SELECTION).startsWith(TEXT_INPUT).endsWith(TEXT_INPUT).build();
+        UsagePattern pattern = patternBuilder.concernedNode(SEQUENCE).contains(containsPattern).build();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isTrue();
+    }
+    
+    @Test
+    public void sequence_ends_with_positive_2() {
+        // Given
+        String spec = "Selection {" +
+                      "  EventTask target1 {}" +
+                      "  Sequence {" +
+                      "    EventTask target2 {}" +
+                      "    TextInput target3 {}" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SEQUENCE).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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).contains(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 {" +
+                      "      EventTask target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(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 {}" +
+                      "      EventTask target3 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(ITERATION).contains(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).contains(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).contains(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 {}" +
+                      "      EventTask target6 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(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).contains(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 {" +
+                      "      EventTask target3 {}" +
+                      "      EventTask target4 {}" +
+                      "    }" +
+                      "    Sequence {" +
+                      "      EventTask target5 {}" +
+                      "      EventTask target6 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePattern pattern = new UsagePatternBuilder().concernedNode(SELECTION).contains(TEXT_INPUT).build();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isFalse();
+    }
+
+}
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 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithEventTest.java	(revision 1151)
@@ -0,0 +1,374 @@
+//   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.usability.rules.patterns.visitors.endswith;
+
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.ITERATION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SELECTION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SEQUENCE;
+import static org.fest.assertions.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+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;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+public class EndsWithEventTest {
+
+    @Test
+    public void sequence_ends_with_positive_1() {
+        // Given
+        String spec = "Sequence {" + 
+                      "  TextInput () {}" + 
+                      "}";
+        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_2() {
+        // 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 {" +
+                      "      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 {}" +
+                      "      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).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 {}" +
+                      "      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();
+        // When
+        boolean patternContained = pattern.containedIn(taskTree);
+        // Then
+        assertThat(patternContained).isFalse();
+    }
+
+}
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 1151)
+++ trunk/autoquest-core-usability-evaluation-test/src/main/java/de/ugoe/cs/autoquest/usability/rules/patterns/visitors/endswith/EndsWithPatternTest.java	(revision 1151)
@@ -0,0 +1,452 @@
+//   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.usability.rules.patterns.visitors.endswith;
+
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.MOUSE_CLICK;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.EventTypeFilter.TEXT_INPUT;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.ITERATION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SELECTION;
+import static de.ugoe.cs.autoquest.usability.tasktree.filters.TaskTreeNodeTypeFilter.SEQUENCE;
+import static org.fest.assertions.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTree;
+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;
+
+/**
+ * <p>
+ * TODO comment
+ * </p>
+ * 
+ * @author Alexander Deicke
+ */
+public class EndsWithPatternTest {
+
+    @Test
+    public void sequence_starts_with_positive_1() {
+        // Given
+        String spec = "Sequence {" +
+                      "  EventTask target2 {}" +
+                      "  EventTask target3 {}" +
+                      "  Selection {" +
+                      "    Sequence {" +
+                      "      TextInput target4 {}" +
+                      "      MouseClick target2 {}" +
+                      "    }" +
+                      "    Sequence {" +
+                      "      TextInput target4 {}" +
+                      "      EventTask target2 {}" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
+        UsagePattern endsWithPattern = patternBuilder.concernedNode(SELECTION).startsWith(TEXT_INPUT).endsWith(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_2() {
+        // Given
+        String spec = "Selection {" +
+                      "  EventTask target1 {}" +
+                      "  Sequence {" +
+                      "    Iteration {" +
+                      "      Sequence {" +
+                      "        TextInput target4 {}" +
+                      "        MouseClick target2 {}" +
+                      "        TextInput target4 {}" +
+                      "      }" +
+                      "    }" +
+                      "  }" +
+                      "}";
+        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 {}" +
+                      "    }" +
+                      "  }" +
+                      "  Sequence {" +
+                      "    EventTask target5 {}" +
+                      "    EventTask target6 {}" +
+                      "  }" +
+                      "}";
+        ITaskTree taskTree = GenerateTaskTreeUtil.getTaskTreeFromSpec(spec);
+        UsagePatternBuilder patternBuilder = new UsagePatternBuilder();
+        UsagePattern endsWithPattern = patternBuilder.concernedNode(ITERATION).startsWith(MOUSE_CLICK).contains(TEXT_INPUT).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_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();
+    }
+
+}
