code: public void raiseEvent(String eventName, Object... args)
  			throws InTrasistionException, InvalidEventException,
  			UnknownEventException, NoTransitionException, CancelledException,
  			AsyncException, NotInTransitionException {
  
  		if (transition != null) throw new InTrasistionException(eventName);
  
  		String dst = transitions.get(new EventKey(eventName, current));
  		if (dst == null) {
  			for (EventKey key : transitions.keySet()) {
  				if (key.event.equals(eventName)) {
  					throw new InvalidEventException(eventName, current);
  				}
  			}
  			throw new UnknownEventException(eventName);
  		}
  
  		Event event = new Event(this, eventName, current, dst, null, false, false, args);
  		callCallbacks(event, CallbackType.BEFORE_EVENT);
  
  		if (current.equals(dst)) {
  			callCallbacks(event, CallbackType.AFTER_EVENT);
  			throw new NoTransitionException(event.error);
  		}
  
  		// Setup the transition, call it later.
  		transition = () -> {
  			current = dst;
  			try {
  				callCallbacks(event, CallbackType.ENTER_STATE);
  				callCallbacks(event, CallbackType.AFTER_EVENT);
  			} catch (Exception e) {
  				throw new InternalError(e);
  			}
  		};
  
  		callCallbacks(event, CallbackType.LEAVE_STATE);
  
  		// Perform the rest of the transition, if not asynchronous.
  		transition();
  	}
docs: Initiates a state transition with the named event.
  The call takes a variable number of arguments
  that will be passed to the callback, if defined.
  
  It  if the state change is ok or one of these errors:
  - event X inappropriate because previous transition did not complete
  - event X inappropriate in current state Y
  - event X does not exist
  - internal error on state transition
  @throws InTrasistionException
  @throws InvalidEventException
  @throws UnknownEventException
  @throws NoTransitionException
  @throws AsyncException
  @throws CancelledException
  @throws NotInTransitionException