@Test
public void testSkipToNotExistsMatchingPattern() {

	expectedException.expect(MalformedPatternException.class);
	expectedException.expectMessage("The pattern name specified in AfterMatchSkipStrategy can not be found in the given Pattern");
	Pattern<Event, ?> invalidPattern = Pattern.<Event>begin("start",
		AfterMatchSkipStrategy.skipToLast("midd")).where(new SimpleCondition<Event>() {
		@Override
		public boolean filter(Event value) throws Exception {
			return value.getName().contains("a");
		}
	}).next("middle").where(
		new SimpleCondition<Event>() {
			@Override
			public boolean filter(Event value) throws Exception {
				return value.getName().contains("d");
			}
		}
	).oneOrMore().optional().next("end").where(new SimpleCondition<Event>() {
		@Override
		public boolean filter(Event value) throws Exception {
			return value.getName().contains("c");
		}
	});
	NFACompiler.compile(invalidPattern, Event.createTypeSerializer(), false);
}