Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/SequenceInstanceOfTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/SequenceInstanceOfTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/SequenceInstanceOfTest.java	(revision 481)
@@ -0,0 +1,100 @@
+package de.ugoe.cs.quest;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+import de.ugoe.cs.quest.SequenceInstanceOf;
+import de.ugoe.cs.quest.eventcore.Event;
+
+
+/**
+ * The class <code>SequenceInstanceOfTest</code> contains tests for the
+ * class <code>{@link SequenceInstanceOf}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class SequenceInstanceOfTest {
+	
+	@Test
+	public void TestIsCollectionOfSequences_1() throws Exception {
+		Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
+		List<Event<?>> sequence1 = new ArrayList<Event<?>>();
+		sequence1.add(new Event<String>("a"));
+		sequences.add(sequence1);
+		
+		boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
+		assertTrue(result);
+	}
+	
+	@Test
+	public void TestIsCollectionOfSequences_2() throws Exception {
+		Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
+		List<Event<?>> sequence1 = new ArrayList<Event<?>>();
+		sequences.add(sequence1);
+		
+		boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
+		assertFalse(result);
+	}
+	
+	@Test
+	public void TestIsCollectionOfSequences_3() throws Exception {
+		Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
+		
+		boolean result = SequenceInstanceOf.isCollectionOfSequences(sequences);
+		assertFalse(result);
+	}
+	
+	@Test
+	public void TestIsCollectionOfSequences_4() throws Exception {
+		boolean result = SequenceInstanceOf.isCollectionOfSequences(null);
+		assertFalse(result);
+	}
+	
+	@Test
+	public void TestIsCollectionOfSequences_5() throws Exception {
+		boolean result = SequenceInstanceOf.isCollectionOfSequences(new Object());
+		assertFalse(result);
+	}
+	
+	@Test
+	public void TestIsEventSequence_1() throws Exception {
+		List<Event<?>> sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		
+		boolean result = SequenceInstanceOf.isEventSequence(sequence);
+		assertTrue(result);
+	}
+	
+	@Test
+	public void TestIsEventSequence_2() throws Exception {
+		List<Event<?>> sequence = new ArrayList<Event<?>>();
+		
+		boolean result = SequenceInstanceOf.isEventSequence(sequence);
+		assertFalse(result);
+	}
+	
+	@Test
+	public void TestIsEventSequence_3() throws Exception {
+		boolean result = SequenceInstanceOf.isEventSequence(null);
+		assertFalse(result);
+	}
+	
+	@Test
+	public void TestIsEventSequence_4() throws Exception {
+		boolean result = SequenceInstanceOf.isEventSequence(new Object());
+		assertFalse(result);
+	}
+	
+	
+	
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(SequenceInstanceOfTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/TestAll.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/TestAll.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/TestAll.java	(revision 481)
@@ -0,0 +1,29 @@
+package de.ugoe.cs.quest;
+
+import org.junit.runner.JUnitCore;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * The class <code>TestAll</code> builds a suite that can be used to run all
+ * of the tests within its package as well as within any subpackages of its
+ * package.
+ *
+ * @generatedBy CodePro at 12/15/11 3:35 PM
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+	SequenceInstanceOfTest.class,
+	de.ugoe.cs.quest.assertions.TestAll.class,
+	de.ugoe.cs.quest.coverage.TestAll.class,
+	de.ugoe.cs.quest.eventcore.TestAll.class,
+	de.ugoe.cs.quest.usageprofiles.TestAll.class
+})
+public class TestAll {
+
+	public static void main(String[] args) {
+		JUnitCore.runClasses(new Class[] { TestAll.class });
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/AssertEventTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/AssertEventTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/AssertEventTest.java	(revision 481)
@@ -0,0 +1,38 @@
+package de.ugoe.cs.quest.assertions;
+
+import org.junit.*;
+
+import de.ugoe.cs.quest.assertions.AssertEvent;
+import de.ugoe.cs.quest.eventcore.mock.MockReplayable;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>AssertEventTest</code> contains tests for the class
+ * <code>{@link AssertEvent}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class AssertEventTest {
+
+	@Test
+	public void testAssertEvent_1() throws Exception {
+		String type = "typeString";
+
+		AssertEvent<MockReplayable> result = new AssertEvent<MockReplayable>(
+				type);
+
+		assertNotNull(result);
+		assertEquals(type, result.getType());
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testAssertEvent_2() throws Exception {
+
+		new AssertEvent<MockReplayable>(null);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(AssertEventTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/FileEqualsReplayTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/FileEqualsReplayTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/FileEqualsReplayTest.java	(revision 481)
@@ -0,0 +1,80 @@
+package de.ugoe.cs.quest.assertions;
+
+import org.junit.*;
+
+import de.ugoe.cs.quest.assertions.FileEqualsReplay;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>FileEqualsReplayTest</code> contains tests for the class
+ * <code>{@link FileEqualsReplay}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class FileEqualsReplayTest {
+
+	private final static String ENDLINE = System.getProperty("line.separator");
+
+	@Test
+	public void testFileEqualsReplay_1() throws Exception {
+		String expectedFile = "expectedFileString";
+		String actualFile = "actualFileString";
+
+		FileEqualsReplay result = new FileEqualsReplay(expectedFile, actualFile);
+
+		assertNotNull(result);
+		assertEquals(expectedFile, result.expectedFile);
+		assertEquals(actualFile, result.actualFile);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testFileEqualsReplay_2() throws Exception {
+		String actualFile = "actualFileString";
+
+		new FileEqualsReplay(null, actualFile);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testFileEqualsReplay_3() throws Exception {
+		String expectedFile = "expectedFileString";
+
+		new FileEqualsReplay(expectedFile, null);
+	}
+
+	@Test
+	public void testGetReplay_1() throws Exception {
+		FileEqualsReplay fixture = new FileEqualsReplay("", "");
+
+		String result = fixture.getReplay();
+
+		assertEquals("  <fileEquals actualFile=\"\" expectedFile=\"\"/>"
+				+ ENDLINE, result);
+	}
+
+	@Test
+	public void testGetReplay_2() throws Exception {
+
+		FileEqualsReplay fixture = new FileEqualsReplay("expectedFileString",
+				"actualFileString");
+
+		String result = fixture.getReplay();
+
+		assertEquals(
+				"  <fileEquals actualFile=\"actualFileString\" expectedFile=\"expectedFileString\"/>"
+						+ ENDLINE, result);
+	}
+
+	@Test
+	public void testGetTarget_1() throws Exception {
+		FileEqualsReplay fixture = new FileEqualsReplay("", "");
+
+		String result = fixture.getTarget();
+
+		assertEquals("targetNotUsed", result);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(FileEqualsReplayTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/TestAll.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/TestAll.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/TestAll.java	(revision 481)
@@ -0,0 +1,27 @@
+package de.ugoe.cs.quest.assertions;
+
+import org.junit.runner.JUnitCore;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * The class <code>TestAll</code> builds a suite that can be used to run all
+ * of the tests within its package as well as within any subpackages of its
+ * package.
+ *
+ * @generatedBy CodePro at 12/21/11 11:53 AM
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+	FileEqualsReplayTest.class,
+	TextEqualsReplayTest.class,
+	AssertEventTest.class
+})
+public class TestAll {
+
+	public static void main(String[] args) {
+		JUnitCore.runClasses(new Class[] { TestAll.class });
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/TextEqualsReplayTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/TextEqualsReplayTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/assertions/TextEqualsReplayTest.java	(revision 481)
@@ -0,0 +1,85 @@
+package de.ugoe.cs.quest.assertions;
+
+import org.junit.*;
+
+import de.ugoe.cs.quest.assertions.TextEqualsReplay;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>TextEqualsReplayTest</code> contains tests for the class
+ * <code>{@link TextEqualsReplay}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class TextEqualsReplayTest {
+
+	private final static String ENDLINE = System.getProperty("line.separator");
+
+	@Test
+	public void testTextEqualsReplay_1() throws Exception {
+		String expectedValue = "expectedValueString";
+		String target = "targetString";
+
+		TextEqualsReplay result = new TextEqualsReplay(expectedValue, target);
+
+		assertNotNull(result);
+		assertEquals(expectedValue, result.expectedValue);
+		assertEquals(target, result.target);
+	}
+
+	@Test
+	public void testTextEqualsReplay_2() throws Exception {
+		String target = "targetString";
+
+		TextEqualsReplay result = new TextEqualsReplay(null, target);
+
+		assertNotNull(result);
+		assertEquals(null, result.expectedValue);
+		assertEquals(target, result.target);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testTextEqualsReplay_3() throws Exception {
+		String expectedValue = "expectedValueString";
+
+		new TextEqualsReplay(expectedValue, null);
+	}
+
+	@Test
+	public void testGetReplay_1() throws Exception {
+		TextEqualsReplay fixture = new TextEqualsReplay("", "");
+
+		String result = fixture.getReplay();
+
+		assertEquals(" <textEquals expectedValue=\"\">" + ENDLINE + "<target>"
+				+ ENDLINE + ENDLINE + "</target>" + ENDLINE + "</textEquals>"
+				+ ENDLINE, result);
+	}
+
+	@Test
+	public void testGetReplay_2() throws Exception {
+		TextEqualsReplay fixture = new TextEqualsReplay("expectedValueString",
+				"targetString");
+
+		String result = fixture.getReplay();
+
+		assertEquals(" <textEquals expectedValue=\"expectedValueString\">"
+				+ ENDLINE + "<target>" + ENDLINE + "targetString" + ENDLINE
+				+ "</target>" + ENDLINE + "</textEquals>" + ENDLINE, result);
+	}
+
+	@Test
+	public void testGetTarget_1() throws Exception {
+		TextEqualsReplay fixture = new TextEqualsReplay("expectedValueString",
+				"targetString");
+
+		String result = fixture.getTarget();
+
+		assertEquals("targetString", result);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(TextEqualsReplayTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObservedTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObservedTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorObservedTest.java	(revision 481)
@@ -0,0 +1,313 @@
+package de.ugoe.cs.quest.coverage;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import de.ugoe.cs.quest.coverage.CoverageCalculatorObserved;
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.MockTrieBasedModel;
+
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>CoverageCalculatorObservedTest</code> contains tests for the
+ * class <code>{@link CoverageCalculatorObserved}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CoverageCalculatorObservedTest {
+	
+	Collection<List<? extends Event<?>>> sequencesObserved;
+	
+	Set<List<? extends Event<?>>> sequencesCovered;
+	Set<List<? extends Event<?>>> sequencesCovered2;
+	Set<List<? extends Event<?>>> sequencesNewPossible;
+	
+	MockTrieBasedModel mockProcess;
+	
+	@Test
+	public void testCoverageCalculatorObserved_1() throws Exception {
+		int length = 2;
+
+		CoverageCalculatorObserved result = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		assertNotNull(result);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorObserved_2() throws Exception {
+		int length = 2;
+
+		new CoverageCalculatorObserved(null,sequencesCovered, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorObserved_3() throws Exception {
+		int length = 2;
+
+		new CoverageCalculatorObserved(sequencesObserved, null, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorObserved_4() throws Exception {
+		int length = 0;
+
+		new CoverageCalculatorObserved(sequencesObserved, sequencesCovered, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorObserved_5() throws Exception {
+		int length = -1;
+
+		new CoverageCalculatorObserved(sequencesObserved, sequencesCovered, length);
+	}
+	
+	@Test
+	public void testCoverageObserved_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		double result = fixture.getCoverageObserved();
+		
+		assertEquals(3.0/6.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testCoverageObserved_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered2, length);
+		
+		double result = fixture.getCoverageObserved();
+		
+		assertEquals(2.0/6.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testCoverageObservedWeigth_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		double result = fixture.getCoverageObservedWeigth(mockProcess);
+		
+		assertEquals(6.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testCoverageObservedWeigth_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered2, length);
+		
+		double result = fixture.getCoverageObservedWeigth(mockProcess);
+		
+		assertEquals(4.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetNewPercentage_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		double result = fixture.getNewPercentage();
+		
+		assertEquals(1.0/4.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetNewPercentage_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered2, length);
+		
+		double result = fixture.getNewPercentage();
+		
+		assertEquals(0.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testCoveragePossibleNew_1() throws Exception {
+		int length = 3;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesNewPossible, length);
+		
+		double result = fixture.getCoveragePossibleNew(mockProcess);
+		
+		assertEquals(1.0/11.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testCoveragePossibleNew_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		double result = fixture.getCoveragePossibleNew(mockProcess);
+		
+		assertEquals(0.0, result, 0.0001);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class ) 
+	public void testCoveragePossibleNew_3() throws Exception {
+		int length = 3;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		fixture.getCoveragePossibleNew(null);
+	}
+	
+	@Test
+	public void testCoveragePossibleNewWeight_1() throws Exception {
+		int length = 3;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesNewPossible, length);
+		
+		double result = fixture.getCoveragePossibleNewWeight(mockProcess);
+		
+		assertEquals(2.0, result, 0.0001);
+	}
+	
+	@Test
+	public void testCoveragePossibleNewWeight_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		double result = fixture.getCoveragePossibleNewWeight(mockProcess);
+		
+		assertEquals(0.0, result, 0.0001);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class ) 
+	public void testCoveragePossibleNewWeight_3() throws Exception {
+		int length = 3;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		fixture.getCoveragePossibleNewWeight(null);
+	}	
+	
+	
+	@Test
+	public void testGetNumObserved_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		int result = fixture.getNumObserved();
+		
+		assertEquals(6, result);
+	}
+	
+	@Test
+	public void testGetNumCovered_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		int result = fixture.getNumCovered();
+		
+		assertEquals(4, result);
+	}
+	
+	@Test
+	public void testGetNumCovered_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered2, length);
+		
+		int result = fixture.getNumCovered();
+		
+		assertEquals(2, result);
+	}
+	
+	@Test
+	public void testGetNumNew_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered, length);
+		
+		int result = fixture.getNumNew();
+		
+		assertEquals(1, result);
+	}
+	
+	@Test
+	public void testGetNumNew_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorObserved fixture = new CoverageCalculatorObserved(
+				sequencesObserved, sequencesCovered2, length);
+		
+		int result = fixture.getNumNew();
+		
+		assertEquals(0, result);
+	}
+	
+	@Before
+	public void setUp() throws Exception {
+		sequencesObserved = new LinkedList<List<? extends Event<?>>>();
+		List<Event<?>> sequence1 = new ArrayList<Event<?>>();
+		sequence1.add(new Event<String>("a"));
+		sequence1.add(new Event<String>("b"));
+		sequence1.add(new Event<String>("r"));
+		sequence1.add(new Event<String>("a"));
+		List<Event<?>> sequence2 = new ArrayList<Event<?>>();
+		sequence2.add(new Event<String>("c"));
+		sequence2.add(new Event<String>("a"));
+		sequence2.add(new Event<String>("d"));
+		sequence2.add(new Event<String>("a"));
+		sequence2.add(new Event<String>("b"));
+		sequence2.add(new Event<String>("r"));
+		sequence2.add(new Event<String>("a"));
+		sequencesObserved.add(sequence1);
+		sequencesObserved.add(sequence2);
+
+		sequencesCovered = new LinkedHashSet<List<? extends Event<?>>>();
+		List<Event<?>> tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		sequencesCovered.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("e"));
+		sequencesCovered.add(tmpList);
+
+		sequencesCovered2 = new LinkedHashSet<List<? extends Event<?>>>();
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		sequencesCovered2.add(tmpList);
+		
+		sequencesNewPossible = new LinkedHashSet<List<? extends Event<?>>>();
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("r"));
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("b"));
+		sequencesNewPossible.add(tmpList);
+		
+		int markovOrder = 2;
+		mockProcess = new MockTrieBasedModel(markovOrder, new Random());
+		mockProcess.train(sequencesObserved);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore()
+				.run(CoverageCalculatorObservedTest.class);
+	}
+
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcessTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcessTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/CoverageCalculatorProcessTest.java	(revision 481)
@@ -0,0 +1,236 @@
+package de.ugoe.cs.quest.coverage;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import de.ugoe.cs.quest.coverage.CoverageCalculatorProcess;
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.MockTrieBasedModel;
+
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>CoverageCalculatorProcessTest</code> contains tests for the
+ * class <code>{@link CoverageCalculatorProcess}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CoverageCalculatorProcessTest {
+
+	Set<List<? extends Event<?>>> sequencesCovered;
+	Set<List<? extends Event<?>>> sequencesCovered2;
+	MockTrieBasedModel mockProcess;
+
+	@Test
+	public void testCoverageCalculatorProcess_1() throws Exception {
+		int length = 2;
+
+		CoverageCalculatorProcess result = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+		assertNotNull(result);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorProcess_2() throws Exception {
+		int length = 2;
+
+		new CoverageCalculatorProcess(null,sequencesCovered, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorProcess_3() throws Exception {
+		int length = 2;
+
+		new CoverageCalculatorProcess(mockProcess, null, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorProcess_4() throws Exception {
+		int length = 0;
+
+		new CoverageCalculatorProcess(mockProcess, sequencesCovered, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testCoverageCalculatorProcess_5() throws Exception {
+		int length = -1;
+
+		new CoverageCalculatorProcess(mockProcess, sequencesCovered, length);
+	}
+
+	@Test
+	public void testGetCoverageAllNoWeight_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		double result = fixture.getCoverageAllNoWeight();
+
+		assertEquals(3.0 / 49.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetCoverageAllNoWeight_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered2, length);
+
+		double result = fixture.getCoverageAllNoWeight();
+
+		assertEquals(2.0 / 49.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetCoveragePossibleNoWeight_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		double result = fixture.getCoveragePossibleNoWeight();
+
+		assertEquals(3.0 / 9.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetCoveragePossibleNoWeight_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered2, length);
+
+		double result = fixture.getCoveragePossibleNoWeight();
+
+		assertEquals(2.0 / 9.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetCoveragePossibleWeight_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		double result = fixture.getCoveragePossibleWeight();
+
+		assertEquals(6.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetCoveragePossibleWeight_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered2, length);
+
+		double result = fixture.getCoveragePossibleWeight();
+
+		assertEquals(4.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetNumCovered_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		int result = fixture.getNumCovered();
+
+		assertEquals(3, result);
+	}
+
+	@Test
+	public void testGetNumCovered_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered2, length);
+
+		int result = fixture.getNumCovered();
+
+		assertEquals(2, result);
+	}
+
+	@Test
+	public void testGetNumPossible_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		int result = fixture.getNumPossible();
+
+		assertEquals(9, result);
+	}
+
+	@Test
+	public void testSetSequences_1() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		fixture.setSequences(sequencesCovered2);
+
+		// testing indirectly if sequences were changed
+		assertEquals(2, fixture.getNumCovered());
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testSetSequences_2() throws Exception {
+		int length = 2;
+		CoverageCalculatorProcess fixture = new CoverageCalculatorProcess(
+				mockProcess, sequencesCovered, length);
+
+		fixture.setSequences(null);
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		Collection<List<? extends Event<?>>> sequences = new LinkedList<List<? extends Event<?>>>();
+		List<Event<?>> sequence1 = new ArrayList<Event<?>>();
+		sequence1.add(new Event<String>("a"));
+		sequence1.add(new Event<String>("b"));
+		sequence1.add(new Event<String>("r"));
+		sequence1.add(new Event<String>("a"));
+		List<Event<?>> sequence2 = new ArrayList<Event<?>>();
+		sequence2.add(new Event<String>("c"));
+		sequence2.add(new Event<String>("a"));
+		sequence2.add(new Event<String>("d"));
+		sequence2.add(new Event<String>("a"));
+		sequence2.add(new Event<String>("b"));
+		sequence2.add(new Event<String>("r"));
+		sequence2.add(new Event<String>("a"));
+		sequences.add(sequence1);
+		sequences.add(sequence2);
+
+		sequencesCovered = new LinkedHashSet<List<? extends Event<?>>>();
+		List<Event<?>> tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		sequencesCovered.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		tmpList.add(new Event<String>("a"));
+		sequencesCovered.add(tmpList);
+
+		sequencesCovered2 = new LinkedHashSet<List<? extends Event<?>>>();
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		sequencesCovered2.add(tmpList);
+
+		int markovOrder = 2;
+		mockProcess = new MockTrieBasedModel(markovOrder, new Random());
+		mockProcess.train(sequences);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore()
+				.run(CoverageCalculatorProcessTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/SequenceToolsTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/SequenceToolsTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/SequenceToolsTest.java	(revision 481)
@@ -0,0 +1,201 @@
+package de.ugoe.cs.quest.coverage;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Random;
+import java.util.Set;
+import de.ugoe.cs.quest.coverage.SequenceTools;
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.quest.usageprofiles.IStochasticProcess;
+import de.ugoe.cs.quest.usageprofiles.MockTrieBasedModel;
+
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>SequenceToolsTest</code> contains tests for the class <code>{@link SequenceTools}</code>.
+ *
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class SequenceToolsTest {
+	
+	Collection<List<? extends Event<?>>> sequences;
+	Set<List<? extends Event<?>>> subSequences;
+	MockTrieBasedModel mockProcess;
+	
+	@Test
+	public void testContainedSubSequences_1()
+		throws Exception {
+		int length = 2;
+
+		Set<List<? extends Event<?>>> result = SequenceTools.containedSubSequences(sequences, length);
+
+		assertNotNull(result);
+		assertTrue(result.containsAll(subSequences));
+		assertEquals(subSequences.size(), result.size());
+	}
+	
+	@Test
+	public void testContainedSubSequences_2()
+		throws Exception {
+		int length = 2;
+
+		Set<List<? extends Event<?>>> result = SequenceTools.containedSubSequences(null, length);
+		assertNotNull(result);
+		assertTrue(result.isEmpty());
+	}
+	
+	@Test(expected=java.security.InvalidParameterException.class)
+	public void testContainedSubSequences_3()
+		throws Exception {
+		int length = 0;
+
+		SequenceTools.containedSubSequences(sequences, length);
+	}
+	
+	@Test(expected=java.security.InvalidParameterException.class)
+	public void testContainedSubSequences_4()
+		throws Exception {
+		int length = -1;
+
+		SequenceTools.containedSubSequences(sequences, length);
+	}
+
+	@Test
+	public void testGenerateWeights_1()
+		throws Exception {
+		Map<List<? extends Event<?>>, Double> result = SequenceTools.generateWeights(mockProcess, subSequences);
+
+		assertNotNull(result);
+		Set<Entry<List<? extends Event<?>>, Double>> entrySet = result.entrySet();
+		assertEquals(subSequences.size(),entrySet.size());
+		for( Entry<List<? extends Event<?>>, Double> entry : entrySet ) {
+			assertEquals(Double.valueOf(2.0d), entry.getValue());
+			assertTrue(subSequences.contains(entry.getKey()));
+		}
+	}
+	
+	@Test
+	public void testGenerateWeights_2()
+		throws Exception {
+		Map<List<? extends Event<?>>, Double> result = SequenceTools.generateWeights(null, subSequences);
+		
+		Set<Entry<List<? extends Event<?>>, Double>> entrySet = result.entrySet();
+		assertEquals(subSequences.size(),entrySet.size());
+		for( Entry<List<? extends Event<?>>, Double> entry : entrySet ) {
+			assertEquals(Double.valueOf(0.0d), entry.getValue());
+			assertTrue(subSequences.contains(entry.getKey()));
+		}
+	}
+	
+	@Test
+	public void testGenerateWeights_3()
+		throws Exception {
+		Map<List<? extends Event<?>>, Double> result = SequenceTools.generateWeights(mockProcess, null);
+		
+		assertNotNull(result);
+		assertTrue(result.isEmpty());
+	}
+
+	@Test
+	public void testNumSequences_1()
+		throws Exception {
+		int length = 2;
+		int expected = 49;
+
+		long result = SequenceTools.numSequences(mockProcess, length);
+
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testNumSequences_2()
+		throws Exception {
+		int length = 2;
+		int expected = 49;
+
+		long result = SequenceTools.numSequences(mockProcess, length);
+
+		assertEquals(expected, result);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class )
+	public void testNumSequences_3()
+		throws Exception {
+		int length = 0;
+
+		SequenceTools.numSequences(mockProcess, length);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class )
+	public void testNumSequences_4()
+		throws Exception {
+		IStochasticProcess process = new FirstOrderMarkovModel(new Random());
+		int length = -1;
+
+		SequenceTools.numSequences(process, length);
+	}
+	
+	@Before
+	public void setUp()
+		throws Exception {
+		sequences = new LinkedList<List<? extends Event<?>>>();
+		List<Event<?>> sequence1 = new ArrayList<Event<?>>();
+		sequence1.add(new Event<String>("a"));
+		sequence1.add(new Event<String>("b"));
+		sequence1.add(new Event<String>("r"));
+		sequence1.add(new Event<String>("a"));
+		List<Event<?>> sequence2 = new ArrayList<Event<?>>();
+		sequence2.add(new Event<String>("c"));
+		sequence2.add(new Event<String>("a"));
+		sequence2.add(new Event<String>("d"));
+		sequence2.add(new Event<String>("a"));
+		sequence2.add(new Event<String>("b"));
+		sequence2.add(new Event<String>("r"));
+		sequence2.add(new Event<String>("a"));
+		sequences.add(sequence1);
+		sequences.add(sequence2);
+		
+		subSequences = new LinkedHashSet<List<? extends Event<?>>>();
+		List<Event<?>> tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("b"));
+		subSequences.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("b"));
+		tmpList.add(new Event<String>("r"));
+		subSequences.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("r"));
+		tmpList.add(new Event<String>("a"));
+		subSequences.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("c"));
+		tmpList.add(new Event<String>("a"));
+		subSequences.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("a"));
+		tmpList.add(new Event<String>("d"));
+		subSequences.add(tmpList);
+		tmpList = new ArrayList<Event<?>>();
+		tmpList.add(new Event<String>("d"));
+		tmpList.add(new Event<String>("a"));
+		subSequences.add(tmpList);
+		
+		int markovOrder = 2;
+		mockProcess = new MockTrieBasedModel(markovOrder, new Random());
+		mockProcess.train(sequences);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(SequenceToolsTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/TestAll.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/TestAll.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/coverage/TestAll.java	(revision 481)
@@ -0,0 +1,26 @@
+package de.ugoe.cs.quest.coverage;
+
+import org.junit.runner.JUnitCore;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * The class <code>TestAll</code> builds a suite that can be used to run all
+ * of the tests within its package as well as within any subpackages of its
+ * package.
+ *
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+	CoverageCalculatorObservedTest.class,
+	CoverageCalculatorProcessTest.class,
+	SequenceToolsTest.class
+})
+public class TestAll {
+
+	public static void main(String[] args) {
+		JUnitCore.runClasses(new Class[] { TestAll.class });
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/EventTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/EventTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/EventTest.java	(revision 481)
@@ -0,0 +1,406 @@
+package de.ugoe.cs.quest.eventcore;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+import nl.jqno.equalsverifier.Warning;
+
+import org.junit.*;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.eventcore.ReplayableEvent;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>EventTest</code> contains tests for the class
+ * <code>{@link Event}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class EventTest {
+
+	@Test
+	public void testEvent_1() throws Exception {
+		String type = "typeString";
+
+		Event<String> result = new Event<String>(type);
+
+		assertNotNull(result);
+		assertEquals(type, result.type);
+		assertNull(result.target);
+		assertNull(result.targetShort);
+		assertEquals("", result.idInfo);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testEvent_2() throws Exception {
+		new Event<String>(null);
+	}
+
+	@Test
+	public void testEquals_1() throws Exception {
+		String type1 = "typeString";
+		String type2 = "typeString";
+		Event<String> fixture = new Event<String>(type1);
+		Event<String> other = new Event<String>(type2);
+
+		boolean result = fixture.equals(other);
+
+		assertTrue(result);
+	}
+
+	@Test
+	public void testEquals_2() throws Exception {
+		String type1 = "typeString1";
+		String type2 = "typeString2";
+		Event<String> fixture = new Event<String>(type1);
+		Event<String> other = new Event<String>(type2);
+
+		boolean result = fixture.equals(other);
+
+		assertFalse(result);
+	}
+
+	@Test
+	public void testEquals_3() throws Exception {
+		String type1 = "typeString";
+		String type2 = "typeString";
+		String target1 = "target";
+		String target2 = "target";
+		Event<String> fixture = new Event<String>(type1);
+		fixture.target = target1;
+		Event<String> other = new Event<String>(type2);
+		other.target = target2;
+
+		boolean result = fixture.equals(other);
+
+		assertTrue(result);
+	}
+
+	@Test
+	public void testEquals_4() throws Exception {
+		String type1 = "typeString1";
+		String type2 = "typeString2";
+		String target1 = "target";
+		String target2 = "target";
+		Event<String> fixture = new Event<String>(type1);
+		fixture.target = target1;
+		Event<String> other = new Event<String>(type2);
+		other.target = target2;
+
+		boolean result = fixture.equals(other);
+
+		assertFalse(result);
+	}
+
+	@Test
+	public void testEquals_5() throws Exception {
+		String type1 = "typeString";
+		String type2 = "typeString";
+		String target1 = "target1";
+		String target2 = "target2";
+		Event<String> fixture = new Event<String>(type1);
+		fixture.target = target1;
+		Event<String> other = new Event<String>(type2);
+		other.target = target2;
+
+		boolean result = fixture.equals(other);
+
+		assertFalse(result);
+	}
+
+	@Test
+	public void testEquals_6() throws Exception {
+		String type = "typeString";
+		Event<String> fixture = new Event<String>(type);
+
+		boolean result = fixture.equals(fixture);
+
+		assertTrue(result);
+	}
+
+	@Test
+	public void testEqualsContract() throws Exception {
+		EqualsVerifier.forClass(Event.class)
+				.suppress(Warning.NONFINAL_FIELDS).withRedefinedSubclass(ReplayableEvent.class)
+				.verify();
+	}
+
+	@Test
+	public void testGetIdInfo_fixture_1() throws Exception {
+		String type = "typeString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.idInfo = idInfo;
+
+		String result = fixture.getIdInfo();
+
+		assertEquals(idInfo, result);
+	}
+
+	@Test
+	public void testGetShortId_1() throws Exception {
+		String type = "typeString";
+		String targetShort = "targetShortString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.targetShort = targetShort;
+
+		String result = fixture.getShortId();
+
+		assertEquals("targetShortString.typeString", result);
+	}
+
+	@Test
+	public void testGetShortId_2() throws Exception {
+		String type = "typeString";
+		String targetShort = "targetShortString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.targetShort = targetShort;
+		fixture.idInfo = idInfo;
+
+		String result = fixture.getShortId();
+
+		assertEquals("targetShortString.typeString.idInfoString", result);
+	}
+
+	@Test
+	public void testGetShortId_3() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target;
+
+		String result = fixture.getShortId();
+
+		assertEquals("targetString.typeString", result);
+	}
+
+	@Test
+	public void testGetStandardId_1() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target;
+
+		String result = fixture.getStandardId();
+
+		assertEquals("targetString.typeString", result);
+	}
+
+	@Test
+	public void testGetStandardId_2() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target;
+		fixture.idInfo = idInfo;
+
+		String result = fixture.getStandardId();
+
+		assertEquals("targetString.typeString.idInfoString", result);
+	}
+
+	@Test
+	public void testGetStandardId_3() throws Exception {
+		String type = "typeString";
+		Event<String> fixture = new Event<String>(type);
+
+		String result = fixture.getStandardId();
+
+		assertEquals("typeString", result);
+	}
+
+	@Test
+	public void testGetStandardId_4() throws Exception {
+		String type = "typeString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.idInfo = idInfo;
+
+		String result = fixture.getStandardId();
+
+		assertEquals("typeString.idInfoString", result);
+	}
+
+	@Test
+	public void testGetTarget_1() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target;
+
+		String result = fixture.getTarget();
+
+		assertEquals(target, result);
+	}
+
+	@Test
+	public void testGetTarget_2() throws Exception {
+		String type = "typeString";
+		Event<String> fixture = new Event<String>(type);
+
+		String result = fixture.getTarget();
+
+		assertNull(result);
+	}
+
+	@Test
+	public void testGetTargetShort_1() throws Exception {
+		String type = "typeString";
+		String targetShort = "targetShort";
+		Event<String> fixture = new Event<String>(type);
+		fixture.targetShort = targetShort;
+
+		String result = fixture.getTargetShort();
+
+		assertEquals(targetShort, result);
+	}
+
+	@Test
+	public void testGetTargetShort_2() throws Exception {
+		String type = "typeString";
+		Event<String> fixture = new Event<String>(type);
+
+		String result = fixture.getTargetShort();
+
+		assertNull(result);
+	}
+
+	@Test
+	public void testGetType_1() throws Exception {
+		String type = "typeString";
+		Event<String> fixture = new Event<String>(type);
+
+		String result = fixture.getType();
+
+		assertEquals(type, result);
+	}
+
+	@Test
+	public void testSetIdInfo_fixture_1() throws Exception {
+		String type = "typeString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+
+		fixture.setIdInfo(idInfo);
+
+		assertEquals(idInfo, fixture.idInfo);
+	}
+
+	@Test
+	public void testSetIdInfo_2() throws Exception {
+		String type = "typeString";
+		String idInfo = null;
+		Event<String> fixture = new Event<String>(type);
+
+		fixture.setIdInfo(idInfo);
+
+		assertEquals(idInfo, fixture.idInfo);
+	}
+
+	@Test
+	public void testSetTarget_1() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		Event<String> fixture = new Event<String>(type);
+
+		boolean result = fixture.setTarget(target);
+
+		assertTrue(result);
+		assertEquals(target, fixture.target);
+	}
+
+	@Test
+	public void testSetTarget_2() throws Exception {
+		String type = "typeString";
+		String target1 = "targetString1";
+		String target2 = "targetString2";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target1;
+
+		boolean result = fixture.setTarget(target2);
+
+		assertFalse(result);
+		assertEquals(target1, fixture.target);
+	}
+
+	@Test
+	public void testSetTargetShort_1() throws Exception {
+		String type = "typeString";
+		String targetShort = "targetShortString";
+		Event<String> fixture = new Event<String>(type);
+
+		boolean result = fixture.setTargetShort(targetShort);
+
+		assertTrue(result);
+		assertEquals(targetShort, fixture.targetShort);
+	}
+
+	@Test
+	public void testSetTargetShort_2() throws Exception {
+		String type = "typeString";
+		String targetShort1 = "targetShortString1";
+		String targetShort2 = "targetShortString2";
+		Event<String> fixture = new Event<String>(type);
+		fixture.targetShort = targetShort1;
+
+		boolean result = fixture.setTargetShort(targetShort2);
+
+		assertFalse(result);
+		assertEquals(targetShort1, fixture.targetShort);
+	}
+
+	@Test
+	public void testToString_1() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target;
+
+		String result = fixture.toString();
+
+		assertEquals("targetString.typeString", result);
+	}
+
+	@Test
+	public void testToString_2() throws Exception {
+		String type = "typeString";
+		String target = "targetString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.target = target;
+		fixture.idInfo = idInfo;
+
+		String result = fixture.toString();
+
+		assertEquals("targetString.typeString.idInfoString", result);
+	}
+
+	@Test
+	public void testToString_3() throws Exception {
+		String type = "typeString";
+		Event<String> fixture = new Event<String>(type);
+
+		String result = fixture.toString();
+
+		assertEquals("typeString", result);
+	}
+
+	@Test
+	public void testToString_4() throws Exception {
+		String type = "typeString";
+		String idInfo = "idInfoString";
+		Event<String> fixture = new Event<String>(type);
+		fixture.idInfo = idInfo;
+
+		String result = fixture.toString();
+
+		assertEquals("typeString.idInfoString", result);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(EventTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/ReplayableEventTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/ReplayableEventTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/ReplayableEventTest.java	(revision 481)
@@ -0,0 +1,474 @@
+package de.ugoe.cs.quest.eventcore;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import junitx.framework.ListAssert;
+import de.ugoe.cs.quest.IReplayDecorator;
+import de.ugoe.cs.quest.eventcore.ReplayableEvent;
+import de.ugoe.cs.quest.eventcore.mock.MockReplayable;
+
+import org.junit.*;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>ReplayableEventTest</code> contains tests for the class
+ * <code>{@link ReplayableEvent}</code>.
+ * 
+ * @generatedBy CodePro at 12/20/11 10:17 AM
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class ReplayableEventTest {
+
+	private static class StubReplayDecorator implements IReplayDecorator {
+
+		private static final long serialVersionUID = 1L;
+
+		@Override
+		public String getHeader() {
+			return null;
+		}
+
+		@Override
+		public String getFooter() {
+			return null;
+		}
+
+		@Override
+		public String getSessionHeader(int sessionId) {
+			return null;
+		}
+
+		@Override
+		public String getSessionFooter(int sessionId) {
+			return null;
+		}
+		
+	}
+
+	@Test
+	public void testReplayableEvent_1() throws Exception {
+		String type = "typeString";
+
+		ReplayableEvent<MockReplayable> result = new ReplayableEvent<MockReplayable>(
+				type);
+
+		assertNotNull(result);
+		assertNotNull(result.replayEvents);
+		assertTrue(result.replayEvents.isEmpty());
+		assertEquals(true, result.replayValid);
+		assertEquals(null, result.decorator);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testReplayableEvent_2() throws Exception {
+		new ReplayableEvent<MockReplayable>(null);
+	}
+
+	@Test
+	public void testAddReplayEvent_1() throws Exception {
+		String type = "typeString";
+		String replayableReplay = "replayString";
+		String replaybleTarget = "replayTargetString";
+		MockReplayable replayable = new MockReplayable(replayableReplay,
+				replaybleTarget);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.addReplayEvent(replayable);
+		
+		
+		assertEquals(1, fixture.replayEvents.size());
+		assertEquals(replayable, fixture.replayEvents.get(0));
+	}
+	
+	@Test
+	public void testAddReplayEvent_2() throws Exception {
+		String type = "typeString";
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replaybleTarget1 = "replayTargetString1";
+		String replaybleTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replaybleTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replaybleTarget2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.addReplayEvent(replayable1);
+		fixture.addReplayEvent(replayable2);
+		
+		
+		assertEquals(2, fixture.replayEvents.size());
+		assertEquals(replayable1, fixture.replayEvents.get(0));
+		assertEquals(replayable2, fixture.replayEvents.get(1));
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class )
+	public void testAddReplayEvent_fixture_3() throws Exception {
+		String type = "typeString";
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.addReplayEvent(null);
+	}
+
+	@Test
+	public void testAddReplaySequence_1() throws Exception {
+		String type = "typeString";
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replaybleTarget1 = "replayTargetString1";
+		String replaybleTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replaybleTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replaybleTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		
+		fixture.addReplaySequence(replaySequence);		
+		
+		assertEquals(2, fixture.replayEvents.size());
+		assertEquals(replayable1, fixture.replayEvents.get(0));
+		assertEquals(replayable2, fixture.replayEvents.get(1));
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class )
+	public void testAddReplaySequence_2() throws Exception {
+		String type = "typeString";
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		
+		fixture.addReplaySequence(null);	
+	}
+
+	@Test
+	public void testEquals_1() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+		fixture.replayValid = replayValid;
+		
+		String typeOther = "typeString";
+		boolean replayValidOther = true;
+		String replayableReplayOther1 = "replayString1";
+		String replayableReplayOther2 = "replayString2";
+		String replaybleTargetOther1 = "replayTargetString1";
+		String replaybleTargetOther2 = "replayTargetString2";
+		MockReplayable replayableOther1 = new MockReplayable(replayableReplayOther1,
+				replaybleTargetOther1);
+		MockReplayable replayableOther2 = new MockReplayable(replayableReplayOther2, replaybleTargetOther2);
+		List<MockReplayable> replaySequenceOther = new LinkedList<MockReplayable>();
+		replaySequenceOther.add(replayableOther1);
+		replaySequenceOther.add(replayableOther2);
+		ReplayableEvent<MockReplayable> other = new ReplayableEvent<MockReplayable>(
+				typeOther);
+		other.replayEvents = replaySequenceOther;
+		other.replayValid = replayValidOther;
+
+		boolean result = fixture.equals(other);
+
+		assertEquals(true, result);
+	}
+	
+	@Test
+	public void testEquals_2() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+		fixture.replayValid = replayValid;
+		
+		String typeOther = "typeString2";
+		boolean replayValidOther = true;
+		String replayableReplayOther1 = "replayString1";
+		String replayableReplayOther2 = "replayString2";
+		String replaybleTargetOther1 = "replayTargetString1";
+		String replaybleTargetOther2 = "replayTargetString2";
+		MockReplayable replayableOther1 = new MockReplayable(replayableReplayOther1,
+				replaybleTargetOther1);
+		MockReplayable replayableOther2 = new MockReplayable(replayableReplayOther2, replaybleTargetOther2);
+		List<MockReplayable> replaySequenceOther = new LinkedList<MockReplayable>();
+		replaySequenceOther.add(replayableOther1);
+		replaySequenceOther.add(replayableOther2);
+		ReplayableEvent<MockReplayable> other = new ReplayableEvent<MockReplayable>(
+				typeOther);
+		other.replayEvents = replaySequenceOther;
+		other.replayValid = replayValidOther;
+
+		boolean result = fixture.equals(other);
+
+		assertEquals(false, result);
+	}
+	
+	@Test
+	public void testEquals_3() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+		fixture.replayValid = replayValid;
+		
+		String typeOther = "typeString";
+		boolean replayValidOther = true;
+		String replayableReplayOther1 = "replayString3";
+		String replayableReplayOther2 = "replayString2";
+		String replaybleTargetOther1 = "replayTargetString1";
+		String replaybleTargetOther2 = "replayTargetString2";
+		MockReplayable replayableOther1 = new MockReplayable(replayableReplayOther1,
+				replaybleTargetOther1);
+		MockReplayable replayableOther2 = new MockReplayable(replayableReplayOther2, replaybleTargetOther2);
+		List<MockReplayable> replaySequenceOther = new LinkedList<MockReplayable>();
+		replaySequenceOther.add(replayableOther1);
+		replaySequenceOther.add(replayableOther2);
+		ReplayableEvent<MockReplayable> other = new ReplayableEvent<MockReplayable>(
+				typeOther);
+		other.replayEvents = replaySequenceOther;
+		other.replayValid = replayValidOther;
+
+		boolean result = fixture.equals(other);
+
+		assertEquals(true, result);
+	}
+	
+	@Test
+	public void testEquals_4() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+		fixture.replayValid = replayValid;
+		
+		String typeOther = "typeString";
+		boolean replayValidOther = true;
+		String replayableReplayOther1 = "replayString1";
+		String replayableReplayOther2 = "replayString3";
+		String replaybleTargetOther1 = "replayTargetString1";
+		String replaybleTargetOther2 = "replayTargetString2";
+		MockReplayable replayableOther1 = new MockReplayable(replayableReplayOther1,
+				replaybleTargetOther1);
+		MockReplayable replayableOther2 = new MockReplayable(replayableReplayOther2, replaybleTargetOther2);
+		List<MockReplayable> replaySequenceOther = new LinkedList<MockReplayable>();
+		replaySequenceOther.add(replayableOther1);
+		replaySequenceOther.add(replayableOther2);
+		ReplayableEvent<MockReplayable> other = new ReplayableEvent<MockReplayable>(
+				typeOther);
+		other.replayEvents = replaySequenceOther;
+		other.replayValid = replayValidOther;
+
+		boolean result = fixture.equals(other);
+
+		assertEquals(true, result);
+	}
+	
+	@Test
+	public void testEquals_5() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+		fixture.replayValid = replayValid;
+		
+		String typeOther = "typeString";
+		boolean replayValidOther = false;
+		String replayableReplayOther1 = "replayString1";
+		String replayableReplayOther2 = "replayString2";
+		String replaybleTargetOther1 = "replayTargetString1";
+		String replaybleTargetOther2 = "replayTargetString2";
+		MockReplayable replayableOther1 = new MockReplayable(replayableReplayOther1,
+				replaybleTargetOther1);
+		MockReplayable replayableOther2 = new MockReplayable(replayableReplayOther2, replaybleTargetOther2);
+		List<MockReplayable> replaySequenceOther = new LinkedList<MockReplayable>();
+		replaySequenceOther.add(replayableOther1);
+		replaySequenceOther.add(replayableOther2);
+		ReplayableEvent<MockReplayable> other = new ReplayableEvent<MockReplayable>(
+				typeOther);
+		other.replayEvents = replaySequenceOther;
+		other.replayValid = replayValidOther;
+
+		boolean result = fixture.equals(other);
+
+		assertEquals(true, result);
+	}
+	
+	@Test
+	public void testEquals_6() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+		fixture.replayValid = replayValid;
+
+		boolean result = fixture.equals(fixture);
+
+		assertEquals(true, result);
+	}
+
+	@Test
+	public void testGetReplayDecorator_1() throws Exception {
+		String type = "typeString";
+		StubReplayDecorator decorator = new StubReplayDecorator();
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.decorator = decorator; 
+
+		IReplayDecorator result = fixture.getReplayDecorator();
+
+		assertEquals(decorator, result);
+	}
+
+	@Test
+	public void testGetReplayMessages_1() throws Exception {
+		String type = "typeString";
+		String replayableReplay1 = "replayString1";
+		String replayableReplay2 = "replayString2";
+		String replayableTarget1 = "replayTargetString1";
+		String replayableTarget2 = "replayTargetString2";
+		MockReplayable replayable1 = new MockReplayable(replayableReplay1,
+				replayableTarget1);
+		MockReplayable replayable2 = new MockReplayable(replayableReplay2, replayableTarget2);
+		List<MockReplayable> replaySequence = new LinkedList<MockReplayable>();
+		replaySequence.add(replayable1);
+		replaySequence.add(replayable2);
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayEvents = replaySequence;
+
+		List<MockReplayable> result = fixture.getReplayMessages();
+
+		ListAssert.assertEquals(replaySequence, result);
+	}
+
+	@Test
+	public void testHasValidReplay_1() throws Exception {
+		String type = "typeString";
+		boolean replayValid = true;
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayValid = replayValid;
+
+		boolean result = fixture.hasValidReplay();
+
+		assertEquals(replayValid, result);
+	}
+	
+	@Test
+	public void testHasValidReplay_2() throws Exception {
+		String type = "typeString";
+		boolean replayValid = false;
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		fixture.replayValid = replayValid;
+
+		boolean result = fixture.hasValidReplay();
+
+		assertEquals(replayValid, result);
+	}
+
+	@Test
+	public void testInvalidateReplay_1() throws Exception {
+		String type = "typeString";
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		
+		fixture.invalidateReplay();
+
+		assertFalse(fixture.replayValid);
+	}
+	
+	@Test
+	public void testInvalidateReplay_2() throws Exception {
+		String type = "typeString";
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+		
+		fixture.invalidateReplay();
+		fixture.invalidateReplay();
+
+		assertFalse(fixture.replayValid);
+	}
+
+	@Test
+	public void testSetDecorator_fixture_1() throws Exception {
+		String type = "typeString";
+		StubReplayDecorator decorator = new StubReplayDecorator();
+		ReplayableEvent<MockReplayable> fixture = new ReplayableEvent<MockReplayable>(
+				type);
+
+		fixture.setDecorator(decorator);
+
+		assertEquals(decorator, fixture.decorator);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(ReplayableEventTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/TestAll.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/TestAll.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/TestAll.java	(revision 481)
@@ -0,0 +1,25 @@
+package de.ugoe.cs.quest.eventcore;
+
+import org.junit.runner.JUnitCore;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * The class <code>TestAll</code> builds a suite that can be used to run all
+ * of the tests within its package as well as within any subpackages of its
+ * package.
+ *
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+	EventTest.class,
+	ReplayableEventTest.class
+})
+public class TestAll {
+
+	public static void main(String[] args) {
+		JUnitCore.runClasses(new Class[] { TestAll.class });
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/mock/MockReplayable.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/mock/MockReplayable.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/eventcore/mock/MockReplayable.java	(revision 481)
@@ -0,0 +1,61 @@
+package de.ugoe.cs.quest.eventcore.mock;
+
+import de.ugoe.cs.quest.eventcore.IReplayable;
+
+public class MockReplayable implements IReplayable {
+
+	private static final long serialVersionUID = 1L;
+
+	final String replay;
+	final String target;
+
+	public MockReplayable(String replay, String target) {
+		this.replay = replay;
+		this.target = target;
+	}
+
+	@Override
+	public String getReplay() {
+		return replay;
+	}
+
+	@Override
+	public String getTarget() {
+		return target;
+	}
+
+	@Override
+	public boolean equals(Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (other instanceof MockReplayable) {
+			if (replay != null && target != null) {
+				return replay.equals(((MockReplayable) other).replay)
+						&& target.equals(((MockReplayable) other).target);
+			} else if (replay != null && target == null) {
+				return replay.equals(((MockReplayable) other).replay)
+						&& ((MockReplayable) other).target == null;
+			} else if (replay == null && target != null) {
+				return ((MockReplayable) other).replay == null
+						&& target.equals(((MockReplayable) other).target);
+			} else {
+				return ((MockReplayable) other).replay == null
+						&& ((MockReplayable) other).target == null;
+			}
+		}
+		return false;
+	}
+	
+	@Override
+	public int hashCode() {
+		int hashCode = 17;
+		if( replay!=null ) {
+			hashCode *= replay.hashCode();
+		}
+		if( target!=null ) {
+			hashCode *= target.hashCode();
+		}
+		return hashCode;
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/DeterministicFiniteAutomatonTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/DeterministicFiniteAutomatonTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/DeterministicFiniteAutomatonTest.java	(revision 481)
@@ -0,0 +1,157 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.DeterministicFiniteAutomaton;
+
+import java.util.Random;
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>DeterministicFiniteAutomatonTest</code> contains tests for
+ * the class <code>{@link DeterministicFiniteAutomaton}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class DeterministicFiniteAutomatonTest {
+
+	Collection<List<? extends Event<?>>> sequences;
+
+	@Test
+	public void testDeterministicFiniteAutomaton_1() throws Exception {
+		Random r = new Random();
+
+		DeterministicFiniteAutomaton result = new DeterministicFiniteAutomaton(
+				r);
+
+		assertNotNull(result);
+		assertEquals(2, result.trieOrder);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testDeterministicFiniteAutomaton_2() throws Exception {
+		new DeterministicFiniteAutomaton(null);
+	}
+
+	@Test
+	public void testGetProbability_1() throws Exception {
+		DeterministicFiniteAutomaton fixture = new DeterministicFiniteAutomaton(
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+		context.add(new Event<String>("b"));
+
+		Event<String> symbol = new Event<String>("r");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(1.0d, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_2() throws Exception {
+		DeterministicFiniteAutomaton fixture = new DeterministicFiniteAutomaton(
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(1.0d / 4.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_3() throws Exception {
+		DeterministicFiniteAutomaton fixture = new DeterministicFiniteAutomaton(
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("c");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(1.0d / 4.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_4() throws Exception {
+		DeterministicFiniteAutomaton fixture = new DeterministicFiniteAutomaton(
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("e");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(0.0d, result, 0.0001);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGetProbability_5() throws Exception {
+		DeterministicFiniteAutomaton fixture = new DeterministicFiniteAutomaton(
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = null;
+
+		fixture.getProbability(context, symbol);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGetProbability_6() throws Exception {
+		DeterministicFiniteAutomaton fixture = new DeterministicFiniteAutomaton(
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = null;
+
+		Event<String> symbol = new Event<String>("a");
+
+		fixture.getProbability(context, symbol);
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		List<Event<?>> sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("c"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("d"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+
+		sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore()
+				.run(DeterministicFiniteAutomatonTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/FirstOrderMarkovModelTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/FirstOrderMarkovModelTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/FirstOrderMarkovModelTest.java	(revision 481)
@@ -0,0 +1,94 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Random;
+import org.junit.*;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel.MarkovEdge;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>FirstOrderMarkovModelTest</code> contains tests for the class
+ * <code>{@link FirstOrderMarkovModel}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class FirstOrderMarkovModelTest {
+
+	Collection<List<? extends Event<?>>> sequences;
+	
+	@Test
+	public void testFirstOrderMarkovModel_1() throws Exception {
+		Random r = new Random();
+
+		FirstOrderMarkovModel result = new FirstOrderMarkovModel(r);
+
+		assertNotNull(result);
+		assertEquals(r, result.r);
+		assertEquals(2, result.trieOrder);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testFirstOrderMarkovModel_2() throws Exception {
+		new FirstOrderMarkovModel(null);
+	}
+	
+	@Test
+	public void testCalcEntropy() throws Exception {
+		Random r = new Random();
+		FirstOrderMarkovModel fixture = new FirstOrderMarkovModel(r);
+		fixture.train(sequences);
+		
+		double result = fixture.calcEntropy();
+		
+		assertEquals(0.7392d, result, 0.0001);
+	}
+	
+	@Test
+	public void testMarkovEdgeMarkovEdge_1() throws Exception {
+		double weight = 0.2d;
+		
+		MarkovEdge result = new MarkovEdge(weight);
+		
+		assertNotNull(result);
+		assertEquals(weight, result.weight, 0.0001);
+	}
+	
+	@Test
+	public void testMarkovEdgeToString_1() throws Exception {
+		double weight = 0.2d;
+		MarkovEdge fixture = new MarkovEdge(weight);
+		
+		String result = fixture.toString();
+		
+		assertEquals(Double.toString(0.2d), result);
+	}
+	
+	@Before
+	public void setUp() throws Exception {
+		List<Event<?>> sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("c"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("d"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+
+		sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(FirstOrderMarkovModelTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/HighOrderMarkovModelTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/HighOrderMarkovModelTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/HighOrderMarkovModelTest.java	(revision 481)
@@ -0,0 +1,241 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.HighOrderMarkovModel;
+
+import java.util.Random;
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>HighOrderMarkovModelTest</code> contains tests for the class
+ * <code>{@link HighOrderMarkovModel}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class HighOrderMarkovModelTest {
+
+	Collection<List<? extends Event<?>>> sequences;
+
+	@Test
+	public void testHighOrderMarkovModel_1() throws Exception {
+		int maxOrder = 1;
+		Random r = new Random();
+
+		HighOrderMarkovModel result = new HighOrderMarkovModel(maxOrder, r);
+
+		assertNotNull(result);
+		assertEquals(r, result.r);
+		assertEquals(maxOrder + 1, result.trieOrder);
+	}
+
+	@Test
+	public void testHighOrderMarkovModel_2() throws Exception {
+		int maxOrder = 0;
+		Random r = new Random();
+
+		HighOrderMarkovModel result = new HighOrderMarkovModel(maxOrder, r);
+
+		assertNotNull(result);
+		assertEquals(r, result.r);
+		assertEquals(maxOrder + 1, result.trieOrder);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testHighOrderMarkovModel_3() throws Exception {
+		int maxOrder = 1;
+		Random r = null;
+
+		new HighOrderMarkovModel(maxOrder, r);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testHighOrderMarkovModel_4() throws Exception {
+		int maxOrder = -1;
+		Random r = new Random();
+
+		new HighOrderMarkovModel(maxOrder, r);
+	}
+
+	@Test
+	public void testGetProbability_1() throws Exception {
+		int markovOrder = 1;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(2.0d / 5.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_2() throws Exception {
+		int markovOrder = 1;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("r");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(0.0d / 5.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_3() throws Exception {
+		int markovOrder = 1;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<String>> context = new ArrayList<Event<String>>();
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("c");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(1.0d / 5.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_4() throws Exception {
+		int markovOrder = 1;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(2.0d / 5.0, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_5() throws Exception {
+		int markovOrder = 2;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(1.0d, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_6() throws Exception {
+		int markovOrder = 2;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("b"));
+
+		Event<String> symbol = new Event<String>("b");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(0.0d, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_7() throws Exception {
+		int markovOrder = 0;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("b"));
+
+		Event<String> symbol = new Event<String>("a");
+
+		double result = fixture.getProbability(context, symbol);
+
+		assertEquals(5.0d / 13.0, result, 0.0001);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGetProbability_8() throws Exception {
+		int markovOrder = 0;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("b"));
+
+		Event<String> symbol = null;
+
+		fixture.getProbability(context, symbol);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGetProbability_9() throws Exception {
+		int markovOrder = 0;
+		HighOrderMarkovModel fixture = new HighOrderMarkovModel(markovOrder,
+				new Random());
+		fixture.train(sequences);
+
+		List<Event<?>> context = null;
+
+		Event<String> symbol = new Event<String>("b");
+
+		fixture.getProbability(context, symbol);
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		List<Event<?>> sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("c"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("d"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+
+		sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(HighOrderMarkovModelTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/IncompleteMemoryTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/IncompleteMemoryTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/IncompleteMemoryTest.java	(revision 481)
@@ -0,0 +1,152 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.*;
+
+import de.ugoe.cs.quest.usageprofiles.IncompleteMemory;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>IncompleteMemoryTest</code> contains tests for the class <code>{@link IncompleteMemory}</code>.
+ *
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class IncompleteMemoryTest {
+
+	@Test
+	public void testIncompleteMemory_1()
+		throws Exception {
+		int length = 1;
+
+		IncompleteMemory<String> result = new IncompleteMemory<String>(length);
+
+		assertNotNull(result);
+		assertEquals(0, result.getLast(1).size());
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testIncompleteMemory_2()
+		throws Exception {
+		int length = 0;
+
+		new IncompleteMemory<String>(length);
+	}
+
+	@Test
+	public void testGetLast_1()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		fixture.add("1");
+		fixture.add("2");
+		fixture.add("3");
+		int num = -1;
+
+		List<String> result = fixture.getLast(num);
+
+		assertNotNull(result);
+		assertEquals(0, result.size());
+	}
+
+	@Test
+	public void testGetLast_2()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		fixture.add("1");
+		fixture.add("2");
+		fixture.add("3");
+		int num = 1;
+		
+		List<String> expected = new ArrayList<String>();
+		expected.add("3");
+
+		List<String> result = fixture.getLast(num);
+
+		assertNotNull(result);
+		assertEquals(expected, result);
+	}
+
+	@Test
+	public void testGetLast_3()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		fixture.add("1");
+		fixture.add("2");
+		fixture.add("3");
+		int num = 2;
+		
+		List<String> expected = new ArrayList<String>();
+		expected.add("2");
+		expected.add("3");
+
+		List<String> result = fixture.getLast(num);
+
+		assertNotNull(result);
+		assertEquals(expected, result);
+	}
+	
+	@Test
+	public void testGetLast_4()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		fixture.add("1");
+		fixture.add("2");
+		fixture.add("3");
+		int num = 3;
+		
+		List<String> expected = new ArrayList<String>();
+		expected.add("2");
+		expected.add("3");
+
+		List<String> result = fixture.getLast(num);
+
+		assertNotNull(result);
+		assertEquals(expected, result);
+	}
+
+	@Test
+	public void testGetLength_1()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		
+		int result = fixture.getLength(); 
+
+		assertEquals(0, result);
+	}
+	
+	@Test
+	public void testGetLength_2()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		fixture.add("1");
+		
+		int result = fixture.getLength(); 
+
+		assertEquals(1, result);
+	}
+	
+	@Test
+	public void testGetLength_3()
+		throws Exception {
+		int length = 2;
+		IncompleteMemory<String> fixture = new IncompleteMemory<String>(length);
+		fixture.add("1");
+		fixture.add("2");
+		fixture.add("3");
+		
+		int result = fixture.getLength(); 
+
+		assertEquals(2, result);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(IncompleteMemoryTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/MockTrieBasedModel.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/MockTrieBasedModel.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/MockTrieBasedModel.java	(revision 481)
@@ -0,0 +1,31 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.TrieBasedModel;
+
+public class MockTrieBasedModel extends TrieBasedModel {
+	private static final long serialVersionUID = 1L;
+
+	public MockTrieBasedModel(int markovOrder, Random r) {
+		super(markovOrder, r);
+	}
+
+	@Override
+	public double getProbability(List<? extends Event<?>> context,
+			Event<?> symbol) {
+		List<Event<?>> list = new ArrayList<Event<?>>();
+		if( context.isEmpty() ) {
+			return 2;
+		}
+		list.add(context.get(context.size()-1));
+		if( trie.find(list).getFollowingSymbols().contains(symbol) ) {
+			return 1;
+		} else {
+			return 0;
+		}
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/ModelFlattenerTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/ModelFlattenerTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/ModelFlattenerTest.java	(revision 481)
@@ -0,0 +1,148 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import org.junit.*;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.FirstOrderMarkovModel;
+import de.ugoe.cs.quest.usageprofiles.HighOrderMarkovModel;
+import de.ugoe.cs.quest.usageprofiles.ModelFlattener;
+import de.ugoe.cs.quest.usageprofiles.PredictionByPartialMatch;
+import de.ugoe.cs.quest.usageprofiles.TrieNode;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>ModelFlattenerTest</code> contains tests for the class <code>{@link ModelFlattener}</code>.
+ *
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class ModelFlattenerTest {
+	
+	List<Event<?>> sequence;
+	
+	private static void assertCollectionContent(Collection<?> c1, Collection<?> c2) {
+		assertEquals(c1.size(), c2.size());
+		for( Object obj : c1 ) {
+			assertTrue(c2.contains(obj));
+		}
+	}
+	
+	@Test
+	public void testFlattenHighOrderMarkovModel_1()
+		throws Exception {
+		ModelFlattener fixture = new ModelFlattener();
+		HighOrderMarkovModel model = new HighOrderMarkovModel(2, new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		model.train(sequences);
+		
+		Collection<Event<?>> expectedSymbols = new HashSet<Event<?>>();
+		expectedSymbols.add(new Event<Object>("a-=-END"));
+		expectedSymbols.add(new Event<Object>("a-=-b"));
+		expectedSymbols.add(new Event<Object>("a-=-c"));
+		expectedSymbols.add(new Event<Object>("a-=-d"));
+		expectedSymbols.add(new Event<Object>("b-=-r"));
+		expectedSymbols.add(new Event<Object>("c-=-a"));
+		expectedSymbols.add(new Event<Object>("d-=-a"));
+		expectedSymbols.add(new Event<Object>("r-=-a"));
+		expectedSymbols.add(new Event<Object>("START-=-a"));
+
+		FirstOrderMarkovModel result = fixture.flattenHighOrderMarkovModel(model);
+		
+		assertCollectionContent(expectedSymbols, result.getEvents());
+		
+		TrieNode<Event<?>> root = result.trie.find(null);
+		TrieNode<Event<?>> root_aEnd = root.getChild(new Event<Object>("a-=-END"));
+		TrieNode<Event<?>> root_ab = root.getChild(new Event<Object>("a-=-b"));
+		TrieNode<Event<?>> root_ab_br = root_ab.getChild(new Event<Object>("b-=-r"));
+		TrieNode<Event<?>> root_ac = root.getChild(new Event<Object>("a-=-c"));
+		TrieNode<Event<?>> root_ac_ca = root_ac.getChild(new Event<Object>("c-=-a"));
+		TrieNode<Event<?>> root_ad = root.getChild(new Event<Object>("a-=-d"));
+		TrieNode<Event<?>> root_ad_da = root_ad.getChild(new Event<Object>("d-=-a"));
+		TrieNode<Event<?>> root_br = root.getChild(new Event<Object>("b-=-r"));
+		TrieNode<Event<?>> root_br_ra = root_br.getChild(new Event<Object>("r-=-a"));
+		TrieNode<Event<?>> root_ca = root.getChild(new Event<Object>("c-=-a"));
+		TrieNode<Event<?>> root_ca_ad = root_ca.getChild(new Event<Object>("a-=-d"));
+		TrieNode<Event<?>> root_da = root.getChild(new Event<Object>("d-=-a"));
+		TrieNode<Event<?>> root_da_ab = root_da.getChild(new Event<Object>("a-=-b"));
+		TrieNode<Event<?>> root_ra = root.getChild(new Event<Object>("r-=-a"));
+		TrieNode<Event<?>> root_ra_ac = root_ra.getChild(new Event<Object> ("a-=-c"));
+		TrieNode<Event<?>> root_ra_aEnd = root_ra.getChild(new Event<Object>("a-=-END"));
+		TrieNode<Event<?>> root_startA = root.getChild(new Event<Object>("START-=-a"));
+		TrieNode<Event<?>> root_startA_ab = root_startA.getChild(new Event<Object>("a-=-b"));
+		
+		assertEquals(1, root_aEnd.getCount());
+		assertTrue(root_aEnd.isLeaf());
+		assertEquals(2, root_ab.getCount());
+		assertEquals(1, root_ab.getChildren().size());
+		assertEquals(2, root_ab_br.getCount());
+		assertTrue(root_ab_br.isLeaf());
+		assertEquals(1, root_ac.getCount());
+		assertEquals(1, root_ac.getChildren().size());
+		assertEquals(1, root_ac_ca.getCount());
+		assertTrue(root_ac_ca.isLeaf());
+		assertEquals(1, root_ad.getCount());
+		assertEquals(1, root_ad.getChildren().size());
+		assertEquals(1, root_ad_da.getCount());
+		assertTrue(root_ad_da.isLeaf());
+		assertEquals(2, root_br.getCount());
+		assertEquals(1, root_br.getChildren().size());
+		assertEquals(2, root_br_ra.getCount());
+		assertTrue(root_br_ra.isLeaf());
+		assertEquals(1, root_ca.getCount());
+		assertEquals(1, root_ca.getChildren().size());
+		assertEquals(1, root_ca_ad.getCount());
+		assertTrue(root_ca_ad.isLeaf());
+		assertEquals(1, root_da.getCount());
+		assertEquals(1, root_da.getChildren().size());
+		assertEquals(1, root_da_ab.getCount());
+		assertTrue(root_da_ab.isLeaf());
+		assertEquals(2, root_ra.getCount());
+		assertEquals(2, root_ra.getChildren().size());
+		assertEquals(1, root_ra_ac.getCount());
+		assertTrue(root_ra_ac.isLeaf());
+		assertEquals(1, root_ra_aEnd.getCount());
+		assertTrue(root_ra_aEnd.isLeaf());
+		assertEquals(1, root_startA.getCount());
+		assertEquals(1, root_startA.getChildren().size());
+		assertEquals(1, root_startA_ab.getCount());
+		assertTrue(root_startA_ab.isLeaf());		
+	}
+
+	@Test
+	public void testFlattenPredictionByPartialMatch_1()
+		throws Exception {
+		ModelFlattener fixture = new ModelFlattener();
+		PredictionByPartialMatch model = new PredictionByPartialMatch(1, new Random());
+
+		FirstOrderMarkovModel result = fixture.flattenPredictionByPartialMatch(model);
+		
+		assertEquals(null, result);
+	}
+
+	@Before
+	public void setUp()
+		throws Exception {
+		sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("c"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("d"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(ModelFlattenerTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/PredictionByPartialMatchTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/PredictionByPartialMatchTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/PredictionByPartialMatchTest.java	(revision 481)
@@ -0,0 +1,365 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.PredictionByPartialMatch;
+
+import java.util.Random;
+import org.junit.*;
+
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>PredictionByPartialMatchTest</code> contains tests for the
+ * class <code>{@link PredictionByPartialMatch}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class PredictionByPartialMatchTest {
+
+	Collection<List<? extends Event<?>>> sequences;
+
+	@Test
+	public void testPredictionByPartialMatch_1() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+
+		PredictionByPartialMatch result = new PredictionByPartialMatch(
+				markovOrder, r);
+
+		assertNotNull(result);
+		assertEquals(markovOrder+1, result.trieOrder);
+		assertEquals(0, result.minOrder);
+		assertEquals(r, result.r);
+		assertEquals(0.1, result.probEscape, 0.0001);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_2() throws Exception {
+		int markovOrder = -1;
+		Random r = new Random();
+
+		new PredictionByPartialMatch(markovOrder, r);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_3() throws Exception {
+		int markovOrder = 2;
+		Random r = null;
+
+		new PredictionByPartialMatch(markovOrder, r);
+	}
+	
+	@Test
+	public void testPredictionByPartialMatch_4() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+
+		PredictionByPartialMatch result = new PredictionByPartialMatch(
+				markovOrder, r, probEscape);
+
+		assertNotNull(result);
+		assertEquals(markovOrder+1, result.trieOrder);
+		assertEquals(0, result.minOrder);
+		assertEquals(r, result.r);
+		assertEquals(probEscape, result.probEscape, 0.0001);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_5() throws Exception {
+		int markovOrder = -1;
+		Random r = new Random();
+		double probEscape = 0.2;
+
+		new PredictionByPartialMatch(markovOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_6() throws Exception {
+		int markovOrder = 2;
+		Random r = null;
+		double probEscape = 0.2;
+
+		new PredictionByPartialMatch(markovOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_7() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.0;
+
+		new PredictionByPartialMatch(markovOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_8() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 1.0;
+
+		new PredictionByPartialMatch(markovOrder, r, probEscape);
+	}
+	
+	@Test
+	public void testPredictionByPartialMatch_9() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 1;
+
+		PredictionByPartialMatch result = new PredictionByPartialMatch(
+				markovOrder, minOrder, r, probEscape);
+
+		assertNotNull(result);
+		assertEquals(markovOrder+1, result.trieOrder);
+		assertEquals(minOrder, result.minOrder);
+		assertEquals(r, result.r);
+		assertEquals(probEscape, result.probEscape, 0.0001);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_10() throws Exception {
+		int markovOrder = -1;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 1;
+
+		new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_11() throws Exception {
+		int markovOrder = 2;
+		Random r = null;
+		double probEscape = 0.2;
+		int minOrder = 1;
+
+		new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_12() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.0;
+		int minOrder = 1;
+
+		new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_13() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 1.0;
+		int minOrder = 1;
+
+		new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_14() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 3;
+
+		new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testPredictionByPartialMatch_15() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = -1;
+
+		new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+	}
+
+	@Test
+	public void testGetProbEscape_1() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 1;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.probEscape = probEscape;
+		
+		double result = fixture.getProbEscape();
+
+		assertEquals(probEscape, result, 0.0001);
+	}
+
+	@Test
+	public void testGetProbability_1() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 1;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.train(sequences);
+		
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+		
+		double result = fixture.getProbability(context, symbol);
+		
+		assertEquals(0.88d, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetProbability_2() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 1;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.train(sequences);
+		
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("c");
+		
+		double result = fixture.getProbability(context, symbol);
+		
+		assertEquals(0.04d, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetProbability_3() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 2;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.train(sequences);
+		
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+		
+		double result = fixture.getProbability(context, symbol);
+		
+		assertEquals(1.0d, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetProbability_4() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 2;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.train(sequences);
+		
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("c");
+		
+		double result = fixture.getProbability(context, symbol);
+		
+		assertEquals(0.0d, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetProbability_5() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 0;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.train(sequences);
+		
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("b");
+		
+		double result = fixture.getProbability(context, symbol);
+		
+		assertEquals(0.8701d, result, 0.0001);
+	}
+	
+	@Test
+	public void testGetProbability_6() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 0;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+		fixture.train(sequences);
+		
+		List<Event<?>> context = new ArrayList<Event<?>>();
+		context.add(Event.STARTEVENT);
+		context.add(new Event<String>("a"));
+
+		Event<String> symbol = new Event<String>("c");
+		
+		double result = fixture.getProbability(context, symbol);
+		
+		assertEquals(0.0350, result, 0.0001);
+	}
+
+	@Test
+	public void testSetProbEscape_1() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+		double probEscape = 0.2;
+		int minOrder = 1;
+		double newProbEscape = 0.3;
+
+		PredictionByPartialMatch fixture = new PredictionByPartialMatch(markovOrder, minOrder, r, probEscape);
+				
+		fixture.setProbEscape(newProbEscape);
+
+		assertEquals(newProbEscape, fixture.probEscape, 0.0001);
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		List<Event<?>> sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("c"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("d"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+
+		sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore()
+				.run(PredictionByPartialMatchTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TestAll.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TestAll.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TestAll.java	(revision 481)
@@ -0,0 +1,31 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import org.junit.runner.JUnitCore;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * The class <code>TestAll</code> builds a suite that can be used to run all
+ * of the tests within its package as well as within any subpackages of its
+ * package.
+ *
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+	DeterministicFiniteAutomatonTest.class,
+	FirstOrderMarkovModelTest.class,
+	HighOrderMarkovModelTest.class,
+	IncompleteMemoryTest.class,
+	ModelFlattenerTest.class,
+	PredictionByPartialMatchTest.class,
+	TrieBasedModelTest.class,	
+	TrieTest.class
+})
+public class TestAll {
+
+	public static void main(String[] args) {
+		JUnitCore.runClasses(new Class[] { TestAll.class });
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieBasedModelTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieBasedModelTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieBasedModelTest.java	(revision 481)
@@ -0,0 +1,635 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+
+import de.ugoe.cs.quest.eventcore.Event;
+import de.ugoe.cs.quest.usageprofiles.Trie;
+import de.ugoe.cs.quest.usageprofiles.TrieBasedModel;
+import de.ugoe.cs.quest.usageprofiles.TrieNode;
+
+import org.junit.*;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>TrieBasedModelTest</code> contains tests for the class
+ * <code>{@link TrieBasedModel}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class TrieBasedModelTest {
+
+	List<Event<?>> sequence;
+	Collection<Event<?>> symbols;
+
+	private void assertTrieStructure(Trie<Event<?>> trie, int numSequences) {
+		TrieNode<Event<?>> root = trie.find(null);
+		TrieNode<Event<?>> root_a = root.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_a_a = root_a.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_a_b = root_a.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_a_b_a = root_a_b
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_a_b_b = root_a_b
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_a_b_c = root_a_b
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_a_b_d = root_a_b
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_a_b_r = root_a_b
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_a_c = root_a.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_a_c_a = root_a_c
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_a_c_b = root_a_c
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_a_c_c = root_a_c
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_a_c_d = root_a_c
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_a_c_r = root_a_c
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_a_d = root_a.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_a_d_a = root_a_d
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_a_d_b = root_a_d
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_a_d_c = root_a_d
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_a_d_d = root_a_d
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_a_d_r = root_a_d
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_a_r = root_a.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_b = root.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_b_a = root_b.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_b_b = root_b.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_b_c = root_b.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_b_d = root_b.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_b_r = root_b.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_b_r_a = root_b_r
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_b_r_b = root_b_r
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_b_r_c = root_b_r
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_b_r_d = root_b_r
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_b_r_r = root_b_r
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_c = root.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_c_a = root_c.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_c_a_a = root_c_a
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_c_a_b = root_c_a
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_c_a_c = root_c_a
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_c_a_d = root_c_a
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_c_a_r = root_c_a
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_c_b = root_c.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_c_c = root_c.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_c_d = root_c.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_c_r = root_c.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_d = root.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_d_a = root_d.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_d_a_a = root_d_a
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_d_a_b = root_d_a
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_d_a_c = root_d_a
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_d_a_d = root_d_a
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_d_a_r = root_d_a
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_d_b = root_d.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_d_c = root_d.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_d_d = root_d.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_d_r = root_d.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_r = root.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_r_a = root_r.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_r_a_a = root_r_a
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_r_a_b = root_r_a
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_r_a_c = root_r_a
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_r_a_d = root_r_a
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_r_a_r = root_r_a
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_r_a_end = root_r_a.getChild(Event.ENDEVENT);
+		TrieNode<Event<?>> root_r_b = root_r.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_r_c = root_r.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_r_d = root_r.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_r_r = root_r.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_start = root.getChild(Event.STARTEVENT);
+		TrieNode<Event<?>> root_start_a = root_start
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_start_a_a = root_start_a
+				.getChild(new Event<String>("a"));
+		TrieNode<Event<?>> root_start_a_b = root_start_a
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_start_a_c = root_start_a
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_start_a_d = root_start_a
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_start_a_r = root_start_a
+				.getChild(new Event<String>("r"));
+		TrieNode<Event<?>> root_start_b = root_start
+				.getChild(new Event<String>("b"));
+		TrieNode<Event<?>> root_start_c = root_start
+				.getChild(new Event<String>("c"));
+		TrieNode<Event<?>> root_start_d = root_start
+				.getChild(new Event<String>("d"));
+		TrieNode<Event<?>> root_start_r = root_start
+				.getChild(new Event<String>("r"));
+
+		assertEquals(numSequences * 5, root_a.getCount());
+		assertNull(root_a_a);
+		assertEquals(numSequences * 2, root_a_b.getCount());
+		assertNull(root_a_b_a);
+		assertNull(root_a_b_b);
+		assertNull(root_a_b_c);
+		assertNull(root_a_b_d);
+		assertEquals(numSequences * 2, root_a_b_r.getCount());
+		assertEquals(numSequences * 1, root_a_c.getCount());
+		assertEquals(numSequences * 1, root_a_c_a.getCount());
+		assertNull(root_a_c_b);
+		assertNull(root_a_c_c);
+		assertNull(root_a_c_d);
+		assertNull(root_a_c_r);
+		assertEquals(numSequences * 1, root_a_d.getCount());
+		assertEquals(numSequences * 1, root_a_d_a.getCount());
+		assertNull(root_a_d_b);
+		assertNull(root_a_d_c);
+		assertNull(root_a_d_d);
+		assertNull(root_a_d_r);
+		assertNull(root_a_r);
+
+		assertEquals(numSequences * 2, root_b.getCount());
+		assertNull(root_b_a);
+		assertNull(root_b_b);
+		assertNull(root_b_c);
+		assertNull(root_b_d);
+		assertEquals(numSequences * 2, root_b_r.getCount());
+		assertEquals(numSequences * 2, root_b_r_a.getCount());
+		assertNull(root_b_r_b);
+		assertNull(root_b_r_c);
+		assertNull(root_b_r_d);
+		assertNull(root_b_r_r);
+
+		assertEquals(numSequences * 1, root_c.getCount());
+		assertEquals(numSequences * 1, root_c_a.getCount());
+		assertNull(root_c_a_a);
+		assertNull(root_c_a_b);
+		assertNull(root_c_a_c);
+		assertEquals(numSequences * 1, root_c_a_d.getCount());
+		assertNull(root_c_a_r);
+		assertNull(root_c_b);
+		assertNull(root_c_c);
+		assertNull(root_c_d);
+		assertNull(root_c_r);
+
+		assertEquals(numSequences * 1, root_d.getCount());
+		assertEquals(numSequences * 1, root_d_a.getCount());
+		assertNull(root_d_a_a);
+		assertEquals(numSequences * 1, root_d_a_b.getCount());
+		assertNull(root_d_a_c);
+		assertNull(root_d_a_d);
+		assertNull(root_d_a_r);
+		assertNull(root_d_b);
+		assertNull(root_d_c);
+		assertNull(root_d_d);
+		assertNull(root_d_r);
+
+		assertEquals(numSequences * 2, root_r.getCount());
+		assertEquals(numSequences * 2, root_r_a.getCount());
+		assertNull(root_r_a_a);
+		assertNull(root_r_a_b);
+		assertEquals(numSequences * 1, root_r_a_c.getCount());
+		assertNull(root_r_a_d);
+		assertNull(root_r_a_r);
+		assertEquals(numSequences * 1, root_r_a_end.getCount());
+		assertNull(root_r_b);
+		assertNull(root_r_c);
+		assertNull(root_r_d);
+		assertNull(root_r_r);
+
+		assertEquals(numSequences * 1, root_start.getCount());
+		assertEquals(numSequences * 1, root_start_a.getCount());
+		assertNull(root_start_a_a);
+		assertEquals(numSequences * 1, root_start_a_b.getCount());
+		assertNull(root_start_a_c);
+		assertNull(root_start_a_d);
+		assertNull(root_start_a_r);
+		assertNull(root_start_b);
+		assertNull(root_start_c);
+		assertNull(root_start_d);
+		assertNull(root_start_r);
+
+		// check if leafs are really leafs
+		assertTrue(root_a_b_r.isLeaf());
+		assertTrue(root_a_c_a.isLeaf());
+		assertTrue(root_a_d_a.isLeaf());
+		assertTrue(root_b_r_a.isLeaf());
+		assertTrue(root_c_a_d.isLeaf());
+		assertTrue(root_d_a_b.isLeaf());
+		assertTrue(root_r_a_c.isLeaf());
+		assertTrue(root_r_a_end.isLeaf());
+	}
+
+	private static void assertCollectionContent(Collection<?> c1,
+			Collection<?> c2) {
+		assertEquals(c1.size(), c2.size());
+		for (Object obj : c1) {
+			assertTrue(c2.contains(obj));
+		}
+	}
+
+	@Test
+	public void testTrieBasedModel_1() throws Exception {
+		int markovOrder = 2;
+		Random r = new Random();
+
+		MockTrieBasedModel result = new MockTrieBasedModel(markovOrder, r);
+
+		assertNotNull(result);
+		assertEquals(markovOrder + 1, result.trieOrder);
+		assertEquals(r, result.r);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testTrieBasedModel_2() throws Exception {
+		int markovOrder = -1;
+		Random r = new Random();
+
+		new MockTrieBasedModel(markovOrder, r);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testTrieBasedModel_3() throws Exception {
+		int markovOrder = 2;
+		Random r = null;
+
+		new MockTrieBasedModel(markovOrder, r);
+	}
+
+	@Test
+	public void testGenerateSequences_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+		int length = 2;
+
+		Collection<List<Event<?>>> expected = new HashSet<List<Event<?>>>();
+		ArrayList<Event<?>> list;
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("a"));
+		list.add(Event.ENDEVENT);
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("b"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("c"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("d"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("b"));
+		list.add(new Event<String>("r"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("c"));
+		list.add(new Event<String>("a"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("d"));
+		list.add(new Event<String>("a"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(new Event<String>("r"));
+		list.add(new Event<String>("a"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		expected.add(list);
+
+		Collection<List<? extends Event<?>>> result = fixture
+				.generateSequences(length);
+
+		assertCollectionContent(expected, result);
+	}
+
+	@Test
+	public void testGenerateSequences_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+		int length = 3;
+
+		Collection<List<Event<?>>> expected = new HashSet<List<Event<?>>>();
+		ArrayList<Event<?>> list;
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		list.add(Event.ENDEVENT);
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("b"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("c"));
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("d"));
+		expected.add(list);
+
+		Collection<List<? extends Event<?>>> result = fixture
+				.generateSequences(length, true);
+
+		assertCollectionContent(expected, result);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGenerateSequences_3() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+		int length = 0;
+
+		fixture.generateSequences(length, false);
+	}
+
+	@Test
+	public void testGenerateValidSequences_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+		int length = 5;
+
+		Collection<List<Event<?>>> expected = new HashSet<List<Event<?>>>();
+		ArrayList<Event<?>> list;
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("c"));
+		list.add(new Event<String>("a"));
+		list.add(Event.ENDEVENT);
+		expected.add(list);
+		list = new ArrayList<Event<?>>();
+		list.add(Event.STARTEVENT);
+		list.add(new Event<String>("a"));
+		list.add(new Event<String>("d"));
+		list.add(new Event<String>("a"));
+		list.add(Event.ENDEVENT);
+		expected.add(list);
+
+		Collection<List<? extends Event<?>>> result = fixture
+				.generateValidSequences(length);
+
+		assertCollectionContent(expected, result);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGenerateValidSequences_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+		int length = 0;
+
+		fixture.generateValidSequences(length);
+	}
+
+	@Test
+	public void testGetEvents_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+
+		fixture.train(sequences);
+
+		Collection<? extends Event<?>> result = fixture.getEvents();
+
+		assertCollectionContent(symbols, result);
+	}
+
+	@Test
+	public void testGetEvents_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+
+		Collection<? extends Event<?>> result = fixture.getEvents();
+
+		assertCollectionContent(new HashSet<Event<?>>(), result);
+	}
+
+	@Test
+	public void testGetNumFOMStates_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+
+		fixture.train(sequences);
+
+		int result = fixture.getNumFOMStates();
+
+		assertEquals(10, result);
+	}
+
+	@Test
+	public void testGetNumFOMStates_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		;
+
+		int result = fixture.getNumFOMStates();
+
+		assertEquals(0, result);
+	}
+
+	@Test
+	public void testGetNumSymbols_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+
+		int result = fixture.getNumSymbols();
+
+		assertEquals(7, result);
+	}
+
+	@Test
+	public void testGetNumSymbols_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+
+		int result = fixture.getNumSymbols();
+
+		assertEquals(0, result);
+	}
+
+	@Test
+	public void testGetNumTransitions_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+
+		int result = fixture.getNumTransitions();
+
+		assertEquals(11, result);
+	}
+
+	@Test
+	public void testGetNumTransitions_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+
+		int result = fixture.getNumTransitions();
+
+		assertEquals(0, result);
+	}
+
+	@Test
+	public void testTrain_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+
+		fixture.train(sequences);
+
+		assertCollectionContent(symbols, fixture.getEvents());
+
+		assertTrieStructure(fixture.trie, 1);
+	}
+
+	@Test
+	public void testTrain_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		sequences.add(sequence);
+
+		fixture.train(sequences);
+
+		assertCollectionContent(symbols, fixture.getEvents());
+
+		assertTrieStructure(fixture.trie, 2);
+	}
+	
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testTrain_3() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = null;
+
+		fixture.train(sequences);
+	}
+
+	@Test
+	public void testUpdate_1() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = new ArrayList<List<? extends Event<?>>>();
+		sequences.add(sequence);
+		fixture.train(sequences);
+
+		fixture.update(sequences);
+
+		assertCollectionContent(symbols, fixture.getEvents());
+		assertTrieStructure(fixture.trie, 2);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testUpdate_2() throws Exception {
+		int markovOrder = 2;
+		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder,
+				new Random());
+		Collection<List<? extends Event<?>>> sequences = null;
+		fixture.trie = null;
+
+		fixture.update(sequences);
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		sequence = new ArrayList<Event<?>>();
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("c"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("d"));
+		sequence.add(new Event<String>("a"));
+		sequence.add(new Event<String>("b"));
+		sequence.add(new Event<String>("r"));
+		sequence.add(new Event<String>("a"));
+
+		symbols = new HashSet<Event<?>>();
+		symbols.add(new Event<String>("a"));
+		symbols.add(new Event<String>("b"));
+		symbols.add(new Event<String>("c"));
+		symbols.add(new Event<String>("d"));
+		symbols.add(new Event<String>("r"));
+		symbols.add(Event.STARTEVENT);
+		symbols.add(Event.ENDEVENT);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(TrieBasedModelTest.class);
+	}
+}
Index: trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieTest.java
===================================================================
--- trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieTest.java	(revision 481)
+++ trunk/quest-core-event-test/src/test/java/de/ugoe/cs/quest/usageprofiles/TrieTest.java	(revision 481)
@@ -0,0 +1,727 @@
+package de.ugoe.cs.quest.usageprofiles;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+import junitx.framework.ListAssert;
+
+import org.junit.*;
+
+import de.ugoe.cs.quest.usageprofiles.Trie;
+import de.ugoe.cs.quest.usageprofiles.TrieNode;
+import de.ugoe.cs.quest.usageprofiles.Trie.Edge;
+import de.ugoe.cs.quest.usageprofiles.Trie.TrieVertex;
+import static org.junit.Assert.*;
+
+/**
+ * The class <code>TrieTest</code> contains tests for the class
+ * <code>{@link Trie}</code>.
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class TrieTest {
+
+	List<String> sequence;
+	Collection<String> symbols;
+
+	private static void assertCollectionContent(Collection<?> c1,
+			Collection<?> c2) {
+		assertEquals(c1.size(), c2.size());
+		for (Object obj : c1) {
+			assertTrue(c2.contains(obj));
+		}
+	}
+
+	@Test
+	public void testTrie_1() throws Exception {
+
+		Trie<String> result = new Trie<String>();
+
+		assertNotNull(result);
+		assertEquals(0, result.getNumLeafs());
+		assertEquals(0, result.getNumSymbols());
+		assertEquals(0, result.getNumLeafAncestors());
+		assertTrue(result.getKnownSymbols().isEmpty());
+	}
+
+	@Test
+	public void testTrie_2() throws Exception {
+		Trie<String> trie1 = new Trie<String>();
+		trie1.train(sequence, 3);
+
+		Trie<String> result = new Trie<String>(trie1);
+
+		assertEquals(trie1, result);
+		assertNotSame(trie1, result);
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testTrie_3() throws Exception {
+		new Trie<String>(null);
+	}
+
+	@Test
+	public void testAdd_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		List<String> seq = new ArrayList<String>();
+		seq.add("a");
+		seq.add("b");
+
+		fixture.add(seq);
+
+		assertEquals(1, fixture.getChild("a").getCount());
+		assertEquals(1, fixture.getChild("a").getChild("b").getCount());
+		assertNull(fixture.getChild("b"));
+	}
+
+	@Test
+	public void testAdd_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+
+		fixture.add(new ArrayList<String>());
+
+		assertEquals(0, fixture.getNumSymbols());
+	}
+
+	@Test
+	public void testAdd_3() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+
+		fixture.add(null);
+
+		assertEquals(0, fixture.getNumSymbols());
+	}
+
+	@Test
+	public void testFind_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> findSequence = new ArrayList<String>();
+		findSequence.add("a");
+		findSequence.add("b");
+		findSequence.add("r");
+		TrieNode<String> expected = fixture.getChild("a").getChild("b")
+				.getChild("r");
+
+		TrieNode<String> result = fixture.find(findSequence);
+
+		assertEquals(expected, result);
+	}
+
+	@Test
+	public void testFind_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> findSequence = new ArrayList<String>();
+		findSequence.add("c");
+		findSequence.add("a");
+		TrieNode<String> expected = fixture.getChild("c").getChild("a");
+
+		TrieNode<String> result = fixture.find(findSequence);
+
+		assertEquals(expected, result);
+	}
+
+	@Test
+	public void testFind_3() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> findSequence = new ArrayList<String>();
+
+		TrieNode<String> result = fixture.find(findSequence);
+
+		assertTrue(result.isRoot());
+	}
+
+	@Test
+	public void testFind_4() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+
+		TrieNode<String> result = fixture.find(null);
+
+		assertTrue(result.isRoot());
+	}
+
+	@Test
+	public void testGetChildCreate_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		String symbol = "a";
+
+		TrieNode<String> result = fixture.getChildCreate(symbol);
+
+		assertEquals(symbol, result.getSymbol());
+		assertEquals(0, result.getCount());
+		assertTrue(result.isLeaf());
+	}
+
+	@Test(expected = java.security.InvalidParameterException.class)
+	public void testGetChildCreate_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.getChildCreate(null);
+	}
+
+	@Test
+	public void testGetContextSuffix_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> context = new ArrayList<String>();
+		context.add("a");
+		context.add("a");
+		context.add("b");
+		List<String> expected = new ArrayList<String>();
+		expected.add("a");
+		expected.add("b");
+
+		List<String> result = fixture.getContextSuffix(context);
+
+		ListAssert.assertEquals(expected, result);
+	}
+
+	@Test
+	public void testGetContextSuffix_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> context = new ArrayList<String>();
+		context.add("a");
+		context.add("a");
+		context.add("b");
+		context.add("r");
+		List<String> expected = new ArrayList<String>();
+		expected.add("b");
+		expected.add("r");
+
+		List<String> result = fixture.getContextSuffix(context);
+
+		ListAssert.assertEquals(expected, result);
+	}
+
+	@Test
+	public void testGetContextSuffix_3() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> context = new ArrayList<String>();
+		context.add("a");
+		context.add("a");
+		context.add("b");
+		context.add("x");
+		List<String> expected = new ArrayList<String>();
+
+		List<String> result = fixture.getContextSuffix(context);
+
+		ListAssert.assertEquals(expected, result);
+	}
+
+	@Test
+	public void testGetContextSuffix_4() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+
+		List<String> result = fixture.getContextSuffix(null);
+
+		// add additional test code here
+		assertNotNull(result);
+		assertEquals(0, result.size());
+	}
+
+	@Test
+	public void testGetContextSuffix_5() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> context = new ArrayList<String>();
+		context.add("a");
+		context.add("a");
+		context.add("b");
+		List<String> expected = new ArrayList<String>();
+		expected.add("a");
+		expected.add("b");
+
+		List<String> result = fixture.getContextSuffix(context);
+
+		ListAssert.assertEquals(expected, result);
+	}
+
+	@Test
+	public void testGetCount_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("a");
+
+		int result = fixture.getCount(subSequence);
+
+		assertEquals(5, result);
+	}
+
+	@Test
+	public void testGetCount_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("a");
+		subSequence.add("b");
+
+		int result = fixture.getCount(subSequence);
+
+		assertEquals(2, result);
+	}
+
+	@Test
+	public void testGetCount_3() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("x");
+
+		int result = fixture.getCount(subSequence);
+
+		assertEquals(0, result);
+	}
+
+	@Test
+	public void testGetCount_4() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+
+		int result = fixture.getCount(subSequence, "a");
+
+		assertEquals(5, result);
+	}
+
+	@Test
+	public void testGetCount_5() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("a");
+		subSequence.add("b");
+
+		int result = fixture.getCount(subSequence, "r");
+
+		assertEquals(2, result);
+	}
+
+	@Test
+	public void testGetCount_6() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+
+		int result = fixture.getCount(subSequence, "x");
+
+		assertEquals(0, result);
+	}
+
+	@Test
+	public void testGetFollowingSymbols_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("a");
+		Collection<String> expected = new ArrayList<String>();
+		expected.add("b");
+		expected.add("c");
+		expected.add("d");
+
+		Collection<String> result = fixture.getFollowingSymbols(subSequence);
+
+		assertCollectionContent(expected, result);
+	}
+
+	@Test
+	public void testGetFollowingSymbols_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("a");
+		subSequence.add("b");
+		subSequence.add("r");
+
+		Collection<String> result = fixture.getFollowingSymbols(subSequence);
+
+		assertEquals(0, result.size());
+	}
+
+	@Test
+	public void testGetFollowingSymbols_3() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+		List<String> subSequence = new ArrayList<String>();
+		subSequence.add("x");
+
+		Collection<String> result = fixture.getFollowingSymbols(subSequence);
+
+		assertEquals(0, result.size());
+	}
+
+	@Test
+	public void testGetNumLeafAncestors_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+
+		int result = fixture.getNumLeafAncestors();
+
+		assertEquals(7, result);
+	}
+
+	@Test
+	public void testGetNumLeafs_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+
+		int result = fixture.getNumLeafs();
+
+		assertEquals(7, result);
+	}
+
+	@Test
+	public void testGetNumSymbols_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+
+		int result = fixture.getNumSymbols();
+
+		assertEquals(5, result);
+	}
+
+	@Test
+	public void testTrain_1() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		int maxOrder = 3;
+
+		fixture.train(sequence, maxOrder);
+
+		// check if symbols are correct
+		assertCollectionContent(symbols, fixture.getKnownSymbols());
+
+		// check if counters are correct and only the correct nodes exist
+		TrieNode<String> root = fixture.find(new ArrayList<String>());
+		TrieNode<String> root_a = root.getChild("a");
+		TrieNode<String> root_a_a = root_a.getChild("a");
+		TrieNode<String> root_a_b = root_a.getChild("b");
+		TrieNode<String> root_a_b_a = root_a_b.getChild("a");
+		TrieNode<String> root_a_b_b = root_a_b.getChild("b");
+		TrieNode<String> root_a_b_c = root_a_b.getChild("c");
+		TrieNode<String> root_a_b_d = root_a_b.getChild("d");
+		TrieNode<String> root_a_b_r = root_a_b.getChild("r");
+		TrieNode<String> root_a_c = root_a.getChild("c");
+		TrieNode<String> root_a_c_a = root_a_c.getChild("a");
+		TrieNode<String> root_a_c_b = root_a_c.getChild("b");
+		TrieNode<String> root_a_c_c = root_a_c.getChild("c");
+		TrieNode<String> root_a_c_d = root_a_c.getChild("d");
+		TrieNode<String> root_a_c_r = root_a_c.getChild("r");
+		TrieNode<String> root_a_d = root_a.getChild("d");
+		TrieNode<String> root_a_d_a = root_a_d.getChild("a");
+		TrieNode<String> root_a_d_b = root_a_d.getChild("b");
+		TrieNode<String> root_a_d_c = root_a_d.getChild("c");
+		TrieNode<String> root_a_d_d = root_a_d.getChild("d");
+		TrieNode<String> root_a_d_r = root_a_d.getChild("r");
+		TrieNode<String> root_a_r = root_a.getChild("r");
+		TrieNode<String> root_b = root.getChild("b");
+		TrieNode<String> root_b_a = root_b.getChild("a");
+		TrieNode<String> root_b_b = root_b.getChild("b");
+		TrieNode<String> root_b_c = root_b.getChild("c");
+		TrieNode<String> root_b_d = root_b.getChild("d");
+		TrieNode<String> root_b_r = root_b.getChild("r");
+		TrieNode<String> root_b_r_a = root_b_r.getChild("a");
+		TrieNode<String> root_b_r_b = root_b_r.getChild("b");
+		TrieNode<String> root_b_r_c = root_b_r.getChild("c");
+		TrieNode<String> root_b_r_d = root_b_r.getChild("d");
+		TrieNode<String> root_b_r_r = root_b_r.getChild("r");
+		TrieNode<String> root_c = root.getChild("c");
+		TrieNode<String> root_c_a = root_c.getChild("a");
+		TrieNode<String> root_c_a_a = root_c_a.getChild("a");
+		TrieNode<String> root_c_a_b = root_c_a.getChild("b");
+		TrieNode<String> root_c_a_c = root_c_a.getChild("c");
+		TrieNode<String> root_c_a_d = root_c_a.getChild("d");
+		TrieNode<String> root_c_a_r = root_c_a.getChild("r");
+		TrieNode<String> root_c_b = root_c.getChild("b");
+		TrieNode<String> root_c_c = root_c.getChild("c");
+		TrieNode<String> root_c_d = root_c.getChild("d");
+		TrieNode<String> root_c_r = root_c.getChild("r");
+		TrieNode<String> root_d = root.getChild("d");
+		TrieNode<String> root_d_a = root_d.getChild("a");
+		TrieNode<String> root_d_a_a = root_d_a.getChild("a");
+		TrieNode<String> root_d_a_b = root_d_a.getChild("b");
+		TrieNode<String> root_d_a_c = root_d_a.getChild("c");
+		TrieNode<String> root_d_a_d = root_d_a.getChild("d");
+		TrieNode<String> root_d_a_r = root_d_a.getChild("r");
+		TrieNode<String> root_d_b = root_d.getChild("b");
+		TrieNode<String> root_d_c = root_d.getChild("c");
+		TrieNode<String> root_d_d = root_d.getChild("d");
+		TrieNode<String> root_d_r = root_d.getChild("r");
+		TrieNode<String> root_r = root.getChild("r");
+		TrieNode<String> root_r_a = root_r.getChild("a");
+		TrieNode<String> root_r_a_a = root_r_a.getChild("a");
+		TrieNode<String> root_r_a_b = root_r_a.getChild("b");
+		TrieNode<String> root_r_a_c = root_r_a.getChild("c");
+		TrieNode<String> root_r_a_d = root_r_a.getChild("d");
+		TrieNode<String> root_r_a_r = root_r_a.getChild("r");
+		TrieNode<String> root_r_b = root_r.getChild("b");
+		TrieNode<String> root_r_c = root_r.getChild("c");
+		TrieNode<String> root_r_d = root_r.getChild("d");
+		TrieNode<String> root_r_r = root_r.getChild("r");
+
+		assertEquals(5, root_a.getCount());
+		assertNull(root_a_a);
+		assertEquals(2, root_a_b.getCount());
+		assertNull(root_a_b_a);
+		assertNull(root_a_b_b);
+		assertNull(root_a_b_c);
+		assertNull(root_a_b_d);
+		assertEquals(2, root_a_b_r.getCount());
+		assertEquals(1, root_a_c.getCount());
+		assertEquals(1, root_a_c_a.getCount());
+		assertNull(root_a_c_b);
+		assertNull(root_a_c_c);
+		assertNull(root_a_c_d);
+		assertNull(root_a_c_r);
+		assertEquals(1, root_a_d.getCount());
+		assertEquals(1, root_a_d_a.getCount());
+		assertNull(root_a_d_b);
+		assertNull(root_a_d_c);
+		assertNull(root_a_d_d);
+		assertNull(root_a_d_r);
+		assertNull(root_a_r);
+
+		assertEquals(2, root_b.getCount());
+		assertNull(root_b_a);
+		assertNull(root_b_b);
+		assertNull(root_b_c);
+		assertNull(root_b_d);
+		assertEquals(2, root_b_r.getCount());
+		assertEquals(2, root_b_r_a.getCount());
+		assertNull(root_b_r_b);
+		assertNull(root_b_r_c);
+		assertNull(root_b_r_d);
+		assertNull(root_b_r_r);
+
+		assertEquals(1, root_c.getCount());
+		assertEquals(1, root_c_a.getCount());
+		assertNull(root_c_a_a);
+		assertNull(root_c_a_b);
+		assertNull(root_c_a_c);
+		assertEquals(1, root_c_a_d.getCount());
+		assertNull(root_c_a_r);
+		assertNull(root_c_b);
+		assertNull(root_c_c);
+		assertNull(root_c_d);
+		assertNull(root_c_r);
+
+		assertEquals(1, root_d.getCount());
+		assertEquals(1, root_d_a.getCount());
+		assertNull(root_d_a_a);
+		assertEquals(1, root_d_a_b.getCount());
+		assertNull(root_d_a_c);
+		assertNull(root_d_a_d);
+		assertNull(root_d_a_r);
+		assertNull(root_d_b);
+		assertNull(root_d_c);
+		assertNull(root_d_d);
+		assertNull(root_d_r);
+
+		assertEquals(2, root_r.getCount());
+		assertEquals(2, root_r_a.getCount());
+		assertNull(root_r_a_a);
+		assertNull(root_r_a_b);
+		assertEquals(1, root_r_a_c.getCount());
+		assertNull(root_r_a_d);
+		assertNull(root_r_a_r);
+		assertNull(root_r_b);
+		assertNull(root_r_c);
+		assertNull(root_r_d);
+		assertNull(root_r_r);
+
+		// check if leafs are really leafs
+		assertTrue(root_a_b_r.isLeaf());
+		assertTrue(root_a_c_a.isLeaf());
+		assertTrue(root_a_d_a.isLeaf());
+		assertTrue(root_b_r_a.isLeaf());
+		assertTrue(root_c_a_d.isLeaf());
+		assertTrue(root_d_a_b.isLeaf());
+		assertTrue(root_r_a_c.isLeaf());
+	}
+
+	@Test
+	public void testTrain_2() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		int maxOrder = 0;
+
+		fixture.train(sequence, maxOrder);
+
+		assertTrue(fixture.getKnownSymbols().isEmpty());
+	}
+
+	@Test
+	public void testTrain_3() throws Exception {
+		Trie<Object> fixture = new Trie<Object>();
+		List<Object> sequence = new ArrayList<Object>();
+		int maxOrder = 1;
+
+		fixture.train(sequence, maxOrder);
+
+		assertTrue(fixture.getKnownSymbols().isEmpty());
+	}
+
+	@Test
+	public void testTrain_4() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		List<String> sequence = new ArrayList<String>();
+		sequence.add("a");
+		sequence.add("b");
+		int maxOrder = 3;
+
+		fixture.train(sequence, maxOrder);
+
+		assertCollectionContent(sequence, fixture.getKnownSymbols());
+		TrieNode<String> root = fixture.find(new ArrayList<String>());
+		TrieNode<String> root_a = root.getChild("a");
+		TrieNode<String> root_a_a = root_a.getChild("a");
+		TrieNode<String> root_a_b = root_a.getChild("b");
+		TrieNode<String> root_b = root.getChild("b");
+		TrieNode<String> root_b_a = root_b.getChild("a");
+		TrieNode<String> root_b_b = root_b.getChild("b");
+
+		assertEquals(1, root_a.getCount());
+		assertNull(root_a_a);
+		assertEquals(1, root_a_b.getCount());
+		assertEquals(1, root_b.getCount());
+		assertNull(root_b_a);
+		assertNull(root_b_b);
+
+		assertTrue(root_a_b.isLeaf());
+		assertTrue(root_b.isLeaf());
+	}
+
+	@Test
+	public void testEdgeEdge_1() throws Exception {
+		Edge result = new Edge();
+
+		assertNotNull(result);
+	}
+
+	@Test
+	public void testTrieVertexTrieVertex_1() throws Exception {
+		String id = "idString";
+
+		TrieVertex result = new TrieVertex(id);
+
+		assertNotNull(result);
+	}
+
+	@Test
+	public void testTrieVertexToString_1() throws Exception {
+		String id = "idString";
+		TrieVertex fixture = new TrieVertex(id);
+
+		String result = fixture.toString();
+
+		assertEquals(id, result);
+	}
+
+	@Test
+	public void testEquals_1() throws Exception {
+		Trie<String> trieOther = new Trie<String>();
+		Trie<String> fixture = new Trie<String>();
+
+		boolean result = fixture.equals(trieOther);
+
+		assertEquals(true, result);
+	}
+
+	@Test
+	public void testEquals_2() throws Exception {
+		Trie<String> trieOther = new Trie<String>();
+		trieOther.train(sequence, 2);
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 2);
+
+		boolean result = fixture.equals(trieOther);
+
+		assertEquals(true, result);
+	}
+
+	@Test
+	public void testEquals_3() throws Exception {
+		Trie<String> trieOther = new Trie<String>();
+		trieOther.train(sequence, 2);
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 3);
+
+		boolean result = fixture.equals(trieOther);
+
+		assertEquals(false, result);
+	}
+
+	@Test
+	public void testEquals_4() throws Exception {
+		Trie<String> trieOther = new Trie<String>();
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 2);
+
+		boolean result = fixture.equals(trieOther);
+
+		assertEquals(false, result);
+	}
+
+	@Test
+	public void testEquals_5() throws Exception {
+		Trie<String> trieOther = new Trie<String>();
+		trieOther.train(sequence, 2);
+		Trie<String> fixture = new Trie<String>();
+
+		boolean result = fixture.equals(trieOther);
+
+		assertEquals(false, result);
+	}
+
+	@Test
+	public void testEquals_6() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 2);
+
+		boolean result = fixture.equals(fixture);
+
+		assertEquals(true, result);
+	}
+
+	@Test
+	public void testEquals_7() throws Exception {
+		Trie<String> fixture = new Trie<String>();
+		fixture.train(sequence, 2);
+
+		boolean result = fixture.equals(null);
+
+		assertEquals(false, result);
+	}
+
+	@Before
+	public void setUp() throws Exception {
+		sequence = new ArrayList<String>();
+		sequence.add("a");
+		sequence.add("b");
+		sequence.add("r");
+		sequence.add("a");
+		sequence.add("c");
+		sequence.add("a");
+		sequence.add("d");
+		sequence.add("a");
+		sequence.add("b");
+		sequence.add("r");
+		sequence.add("a");
+
+		symbols = new HashSet<String>();
+		symbols.add("a");
+		symbols.add("b");
+		symbols.add("c");
+		symbols.add("d");
+		symbols.add("r");
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(TrieTest.class);
+	}
+}
