/// <summary>
 /// Throws an exception if the specified transition is already defined on this state.
 /// </summary>
 /// <param name="transitionDefinition">The transition.</param>
 private void CheckTransitionDoesNotYetExist(TransitionDefinition <TState, TEvent> transitionDefinition)
 {
     if (transitionDefinition.Source != null)
     {
         throw new InvalidOperationException(TransitionsExceptionMessages.TransitionDoesAlreadyExist(transitionDefinition, this.state));
     }
 }
        /// <summary>
        /// Adds the specified event id.
        /// </summary>
        /// <param name="eventId">The event id.</param>
        /// <param name="transitionDefinition">The transition.</param>
        public void Add(TEvent eventId, TransitionDefinition <TState, TEvent> transitionDefinition)
        {
            Guard.AgainstNullArgument("transition", transitionDefinition);

            this.CheckTransitionDoesNotYetExist(transitionDefinition);

            transitionDefinition.Source = this.state;

            this.MakeSureEventExistsInTransitionList(eventId);

            this.transitions[eventId].Add(transitionDefinition);
        }