protected void setCurrentState(final StateEnum state, final boolean enterInitialState, final C context) {
        execute(new Runnable() {
            @Override
            public void run() {
                if (!enterInitialState) {
                    StateEnum prevState = context.getState();
                    if (prevState != null) {
                        leave(prevState, context);
                    }
                }

                context.setState(state);
                enter(state, context);
            }
        }, context);
    }