Index: /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/DeterministicFiniteAutomatonTest.java
===================================================================
--- /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/DeterministicFiniteAutomatonTest.java	(revision 343)
+++ /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/DeterministicFiniteAutomatonTest.java	(revision 343)
@@ -0,0 +1,154 @@
+package de.ugoe.cs.eventbench.models;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import de.ugoe.cs.eventbench.data.Event;
+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/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/FirstOrderMarkovModelTest.java
===================================================================
--- /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/FirstOrderMarkovModelTest.java	(revision 343)
+++ /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/FirstOrderMarkovModelTest.java	(revision 343)
@@ -0,0 +1,35 @@
+package de.ugoe.cs.eventbench.models;
+
+import java.util.Random;
+import org.junit.*;
+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 {
+
+	@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);
+	}
+
+	public static void main(String[] args) {
+		new org.junit.runner.JUnitCore().run(FirstOrderMarkovModelTest.class);
+	}
+}
Index: /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/HighOrderMarkovModelTest.java
===================================================================
--- /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/HighOrderMarkovModelTest.java	(revision 343)
+++ /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/HighOrderMarkovModelTest.java	(revision 343)
@@ -0,0 +1,238 @@
+package de.ugoe.cs.eventbench.models;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import de.ugoe.cs.eventbench.data.Event;
+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/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/PredictionByPartialMatchTest.java
===================================================================
--- /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/PredictionByPartialMatchTest.java	(revision 343)
+++ /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/PredictionByPartialMatchTest.java	(revision 343)
@@ -0,0 +1,362 @@
+package de.ugoe.cs.eventbench.models;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import de.ugoe.cs.eventbench.data.Event;
+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/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TestAll.java
===================================================================
--- /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TestAll.java	(revision 342)
+++ /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TestAll.java	(revision 343)
@@ -10,24 +10,20 @@
  * package.
  *
- * @generatedBy CodePro at 10/14/11 11:01 AM
- * @author sherbold
- * @version $Revision: 1.0 $
+ * @author Steffen Herbold
+ * @version 1.0
  */
 @RunWith(Suite.class)
 @Suite.SuiteClasses({
+	DeterministicFiniteAutomatonTest.class,
+	FirstOrderMarkovModelTest.class,
+	HighOrderMarkovModelTest.class,
+	IncompleteMemoryTest.class,
 	ModelFlattenerTest.class,
-	TrieBasedModelTest.class,
-	IncompleteMemoryTest.class,
+	PredictionByPartialMatchTest.class,
+	TrieBasedModelTest.class,	
 	TrieTest.class
 })
 public class TestAll {
 
-	/**
-	 * Launch the test.
-	 *
-	 * @param args the command line arguments
-	 *
-	 * @generatedBy CodePro at 10/14/11 11:01 AM
-	 */
 	public static void main(String[] args) {
 		JUnitCore.runClasses(new Class[] { TestAll.class });
Index: /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TrieBasedModelTest.java
===================================================================
--- /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TrieBasedModelTest.java	(revision 342)
+++ /trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TrieBasedModelTest.java	(revision 343)
@@ -11,14 +11,15 @@
 
 /**
- * The class <code>TrieBasedModelTest</code> contains tests for the class <code>{@link TrieBasedModel}</code>.
- *
+ * 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);
@@ -26,21 +27,36 @@
 		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_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_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_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"));
@@ -50,16 +66,26 @@
 		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_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_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"));
@@ -68,9 +94,14 @@
 		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_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"));
@@ -79,9 +110,14 @@
 		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_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"));
@@ -90,31 +126,41 @@
 		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());
+		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());
+		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());
+		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());
+		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);
@@ -122,23 +168,23 @@
 		assertNull(root_a_d_r);
 		assertNull(root_a_r);
-		
-		assertEquals(numSequences*2, root_b.getCount());
+
+		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());
+		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());
+
+		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());
+		assertEquals(numSequences * 1, root_c_a_d.getCount());
 		assertNull(root_c_a_r);
 		assertNull(root_c_b);
@@ -146,9 +192,9 @@
 		assertNull(root_c_d);
 		assertNull(root_c_r);
-		
-		assertEquals(numSequences*1, root_d.getCount());
-		assertEquals(numSequences*1, root_d_a.getCount());
+
+		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());
+		assertEquals(numSequences * 1, root_d_a_b.getCount());
 		assertNull(root_d_a_c);
 		assertNull(root_d_a_d);
@@ -158,22 +204,22 @@
 		assertNull(root_d_d);
 		assertNull(root_d_r);
-		
-		assertEquals(numSequences*2, root_r.getCount());
-		assertEquals(numSequences*2, root_r_a.getCount());
+
+		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());
+		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());
+		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());
+
+		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());
+		assertEquals(numSequences * 1, root_start_a_b.getCount());
 		assertNull(root_start_a_c);
 		assertNull(root_start_a_d);
@@ -183,5 +229,5 @@
 		assertNull(root_start_d);
 		assertNull(root_start_r);
-		
+
 		// check if leafs are really leafs
 		assertTrue(root_a_b_r.isLeaf());
@@ -194,22 +240,51 @@
 		assertTrue(root_r_a_end.isLeaf());
 	}
-	
-	private static void assertCollectionContent(Collection<?> c1, Collection<?> c2) {
+
+	private static void assertCollectionContent(Collection<?> c1,
+			Collection<?> c2) {
 		assertEquals(c1.size(), c2.size());
-		for( Object obj : c1 ) {
+		for (Object obj : c1) {
 			assertTrue(c2.contains(obj));
 		}
 	}
-	
-	@Test
-	public void testGenerateSequences_1()
-		throws Exception {
-		int markovOrder = 2;
-		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random());
+
+	@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;
@@ -251,6 +326,6 @@
 		expected.add(list);
 
-		
-		Collection<List<? extends Event<?>>> result = fixture.generateSequences(length);
+		Collection<List<? extends Event<?>>> result = fixture
+				.generateSequences(length);
 
 		assertCollectionContent(expected, result);
@@ -258,13 +333,13 @@
 
 	@Test
-	public void testGenerateSequences_2()
-		throws Exception {
-		int markovOrder = 2;
-		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random());
+	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;
@@ -290,14 +365,15 @@
 		expected.add(list);
 
-		Collection<List<? extends Event<?>>> result = fixture.generateSequences(length, true);
+		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());
+	@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);
@@ -309,13 +385,13 @@
 
 	@Test
-	public void testGenerateValidSequences_1()
-		throws Exception {
-		int markovOrder = 2;
-		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random());
+	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;
@@ -335,14 +411,15 @@
 		expected.add(list);
 
-		Collection<List<? extends Event<?>>> result = fixture.generateValidSequences(length);
+		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());
+	@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);
@@ -352,146 +429,158 @@
 		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
-	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
-	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);
-		
+	@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);
 
@@ -500,20 +589,17 @@
 	}
 
-	@Test
-	public void testUpdate_2()
-		throws Exception {
-		int markovOrder = 2;
-		MockTrieBasedModel fixture = new MockTrieBasedModel(markovOrder, new Random());
+	@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);
-		
-		assertNull(fixture.trie);
 	}
 
 	@Before
-	public void setUp()
-		throws Exception {
+	public void setUp() throws Exception {
 		sequence = new ArrayList<Event<?>>();
 		sequence.add(new Event<String>("a"));
@@ -528,5 +614,5 @@
 		sequence.add(new Event<String>("r"));
 		sequence.add(new Event<String>("a"));
-		
+
 		symbols = new HashSet<Event<?>>();
 		symbols.add(new Event<String>("a"));
@@ -539,10 +625,4 @@
 	}
 
-	@After
-	public void tearDown()
-		throws Exception {
-		// Add additional tear down code here
-	}
-
 	public static void main(String[] args) {
 		new org.junit.runner.JUnitCore().run(TrieBasedModelTest.class);
