static void checkEnterStateAnnotation(Object instance, StateMachineDefinitionImpl definition, Method method,
            EnterState ann) throws StateMachineDefinitionException {
        // First of all, we check the parameters
        checkGenericTransitionHasTheRightParameters(method);

        // Second, we check the return type is correct
        Class<?> resultType = method.getReturnType();
        if (resultType == null || (!resultType.equals(EventInfo.class) && !("void".equals(resultType.getName())))) {
            throw new IllegalTransitionAnnotationException("Transition for method " + method.getName()
                    + " is not well defined. Enter phase must return a EventInfo or void");
        }

        definition.defineEnterState(ann, method, instance);
    }