static StateMachineDefinitionImpl checkFieldAnnotations(StateMachineDefinitionImpl stateMachineDefinition,
            Object instance) throws StateMachineDefinitionException {
        Class<?> clazz = instance.getClass();
        
        // Let's process the events and states first.
        // We look for the State, StartState and Event annotations
        for (Field field : clazz.getDeclaredFields()) {
            if (field.isAnnotationPresent(State.class))
                checkStateAnnotation(instance, stateMachineDefinition, field, field.getAnnotation(State.class));

            if (field.isAnnotationPresent(Event.class))
                checkEventAnnotation(instance, stateMachineDefinition, field, field.getAnnotation(Event.class));
        }

        return stateMachineDefinition;
    }