public State( String id, StateType type, String description, EntryAction entryAction, ExitAction existAction, List<Transition> transitions) { this.id = id; this.type = type; this.description = description; this.entryAction = NullAction.guardWith(entryAction); this.existAction = NullAction.guardWith(existAction); if(transitions == null) return; for(Transition trans: transitions) { if(outputs.containsKey(trans.getEventId())) throw new RuntimeException(String.format("Duplicate event: %s found for state: %s", trans.getEventId(), id)); outputs.put(trans.getEventId(), trans); } }