public <C extends StatefulContext> void callOnStateEntered(StateEnum state, C context) throws Exception {
        Handler h = handlers.get(new HandlerType(EventType.STATE_ENTER, null, state));
        if (h != null) {
            ContextHandler<C> contextHandler = (ContextHandler<C>) h;
            contextHandler.call(context);
        }

        h = handlers.get(new HandlerType(EventType.ANY_STATE_ENTER, null, null));
        if (h != null) {
            StateHandler<C> stateHandler = (StateHandler<C>) h;
            stateHandler.call(state, context);
        }
    }