public Transition<S, E> getTransition(final S s, final E e) throws NoTransitionException { StateEntry entry = null; if (s == null) { entry = _initialStateEntry; } else { entry = _states.get(s); assert entry != null : "Cannot retrieve transitions for state " + s; } final Transition<S, E> transition = entry.nextStates.get(e); if (transition == null) { throw new NoTransitionException("Unable to transition to a new state from " + s + " via " + e); } return transition; }