public static boolean hasTransitionedToFinal() {
        log.trace("MessageListener.hasTransitionedToFinal() start ...");
        Event event = StateHandler.INSTANCE.getLastSuccessfulEvent();
        if (event == null) {
            log.trace("MessageListener.hasTransitionedToFinal() getLastSuccessfulEvent null.");
            event = StateHandler.INSTANCE.getLastEvent();
            if (event == null) {
                log.trace("MessageListener.hasTransitionedToFinal() no events.");
                return false;
            }
            if ( StateDescriptorFactory.INSTANCE.isFinal( event.to )) {
                log.trace("MessageListener.hasTransitionedToFinal() event.to is final.");
                if (event.from == null) {
                    //This would typically happen on initialise to a final state
                    log.trace("MessageListener.hasTransitionedToFinal() lastEvent hasTransitionedToFinal from a null state.");
                    return true;
                }
                else if ( StateDescriptorFactory.INSTANCE.isInitial( event.from ) && ( event.success == null ) ) {
                    log.trace("MessageListener.hasTransitionedToFinal() lastEvent hasTransitionedToFinal from null to.");
                    return true;
                }
                log.trace("MessageListener.hasTransitionedToFinal() Last unsuccessful event from non initial to final not allowed.");
                return false;
            }
            log.trace("MessageListener.hasTransitionedToFinal() Unsuccessful transition to no Final state");
            return false;
        }

        StateDescriptor toState = event.to;
        log.trace("MessageListener.hasTransitionedToFinal() toState "+ event.to.name +" is final = " + StateDescriptorFactory.INSTANCE.isFinal(toState) +".");
        return StateDescriptorFactory.INSTANCE.isFinal(toState);
    }