test_class.file: flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/nfa/compiler/NFACompilerTest.java
test_class.identifier: NFACompilerTest
test_class.superclass: extends TestLogger
test_case.body: @Test
  	public void testNFACompilerWithSimplePattern() {
  		Pattern<Event, Event> pattern = Pattern.<Event>begin("start").where(new FilterFunction<Event>() {
  			private static final long serialVersionUID = 3314714776170474221L;
  
  			@Override
  			public boolean filter(Event value) throws Exception {
  				return value.getPrice() > 2;
  			}
  		})
  		.followedBy("middle").subtype(SubEvent.class)
  		.next("end").where(new FilterFunction<Event>() {
  				private static final long serialVersionUID = 3990995859716364087L;
  
  				@Override
  			public boolean filter(Event value) throws Exception {
  				return value.getName().equals("end");
  			}
  		});
  
  		TypeInformation<Event> typeInformation = (TypeInformation<Event>) TypeExtractor.createTypeInfo(Event.class);
  
  		NFA<Event> nfa = NFACompiler.<Event>compile(pattern, typeInformation.createSerializer(new ExecutionConfig()));
  
  		Set<State<Event>> states = nfa.getStates();
  
  		assertEquals(4, states.size());
  
  		Map<String, State<Event>> stateMap = new HashMap<>();
  
  		for (State<Event> state: states) {
  			stateMap.put(state.getName(), state);
  		}
  
  		assertTrue(stateMap.containsKey(NFACompiler.BEGINNING_STATE_NAME));
  		State<Event> beginningState = stateMap.get(NFACompiler.BEGINNING_STATE_NAME);
  
  		assertTrue(beginningState.isStart());
  
  		assertTrue(stateMap.containsKey("start"));
  		State<Event> startState = stateMap.get("start");
  
  		Collection<StateTransition<Event>> startTransitions = startState.getStateTransitions();
  		Map<String, StateTransition<Event>> startTransitionMap = new HashMap<>();
  
  		for (StateTransition<Event> transition: startTransitions) {
  			startTransitionMap.put(transition.getTargetState().getName(), transition);
  		}
  
  		assertEquals(2, startTransitionMap.size());
  		assertTrue(startTransitionMap.containsKey("start"));
  
  		StateTransition<Event> reflexiveTransition = startTransitionMap.get("start");
  		assertEquals(StateTransitionAction.IGNORE, reflexiveTransition.getAction());
  
  		assertTrue(startTransitionMap.containsKey("middle"));
  		StateTransition<Event> startMiddleTransition = startTransitionMap.get("middle");
  		assertEquals(StateTransitionAction.TAKE, startMiddleTransition.getAction());
  
  		assertTrue(stateMap.containsKey("middle"));
  		State<Event> middleState = stateMap.get("middle");
  
  		Map<String, StateTransition<Event>> middleTransitionMap = new HashMap<>();
  
  		for (StateTransition<Event> transition: middleState.getStateTransitions()) {
  			middleTransitionMap.put(transition.getTargetState().getName(), transition);
  		}
  
  		assertEquals(1, middleTransitionMap.size());
  
  		assertTrue(middleTransitionMap.containsKey("end"));
  		StateTransition<Event> middleEndTransition = middleTransitionMap.get("end");
  
  		assertEquals(StateTransitionAction.TAKE, middleEndTransition.getAction());
  
  		assertTrue(stateMap.containsKey("end"));
  		State<Event> endState = stateMap.get("end");
  
  		assertTrue(endState.isFinal());
  		assertEquals(0, endState.getStateTransitions().size());
  	}
test_case.class_method_signature: NFACompilerTest.testNFACompilerWithSimplePattern()
test_case.full_signature: @Test public void testNFACompilerWithSimplePattern()
test_case.identifier: testNFACompilerWithSimplePattern
test_case.invocations: where next subtype followedBy where begin getPrice equals getName createTypeInfo compile createSerializer getStates assertEquals size put getName assertTrue containsKey get assertTrue isStart assertTrue containsKey get getStateTransitions put getName getTargetState assertEquals size assertTrue containsKey get assertEquals getAction assertTrue containsKey get assertEquals getAction assertTrue containsKey get getStateTransitions put getName getTargetState assertEquals size assertTrue containsKey get assertEquals getAction assertTrue containsKey get assertTrue isFinal assertEquals size getStateTransitions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNFACompilerWithSimplePattern()
focal_class.declarator: BEGINNING_STATE_NAME = "$beginningState$"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String BEGINNING_STATE_NAME = "$beginningState$";
focal_class.type: String
focal_class.var_name: BEGINNING_STATE_NAME
focal_class.file: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java
focal_class.identifier: NFACompiler
focal_class.class_method_signature: NFACompiler.compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.full_signature: public static NFA<T> compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.identifier: compile
focal_class.modifiers: public static
focal_class.parameters: (Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.return: NFA<T>
focal_class.signature: NFA<T> compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.class_method_signature: NFACompiler.compileFactory(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.full_signature: @SuppressWarnings("unchecked") public static NFAFactory<T> compileFactory(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.identifier: compileFactory
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: (Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_class.return: NFAFactory<T>
focal_class.signature: NFAFactory<T> compileFactory(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_method.body: public static <T> NFA<T> compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer) {
  		NFAFactory<T> factory = compileFactory(pattern, inputTypeSerializer);
  
  		return factory.createNFA();
  	}
focal_method.class_method_signature: NFACompiler.compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_method.full_signature: public static NFA<T> compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_method.identifier: compile
focal_method.invocations: compileFactory createNFA
focal_method.modifiers: public static
focal_method.parameters: (Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)
focal_method.return: NFA<T>
focal_method.signature: NFA<T> compile(Pattern<T, ?> pattern, TypeSerializer<T> inputTypeSerializer)