static void checkExitStateAnnotation(Object instance, StateMachineDefinitionImpl definition, Method method,
            ExitState 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(Boolean.class) && !("void".equals(resultType.getName())))) {
            throw new IllegalTransitionAnnotationException("Transition for method " + method.getName()
                    + " is not well defined. Exit phase must return a boolean or void");
        }
        
        definition.defineExitState(ann, method, instance);
    }