tinymachine/src/main/java/de/halfbit/tinymachine/TinyMachine.java
private void processTaskQueue() {
        mQueueProcessed = true;
        try {
            Task task;
            while((task = mTaskQueue.poll()) != null) {
                switch (task.code) {

                    case Task.CODE_FIRE_EVENT: {
                        Object event = task.event;
                        final Class<? extends Object> clazz = event.getClass();
                        fire(clazz, event, StateHandler.STATE_ANY);
                        fire(clazz, event, mCurrentState);
                        break;
                    }

                    case Task.CODE_TRANSITION: {
                        int state = task.state;
                        if (mCurrentState != state) {
                            fire(OnExit.class, null, StateHandler.STATE_ANY);
                            fire(OnExit.class, null, mCurrentState);
                            mCurrentState = state;
                            if (mTraceTag != null) {
                                log("new state", null);
                            }
                            fire(OnEntry.class, null, StateHandler.STATE_ANY);
                            fire(OnEntry.class, null, mCurrentState);
                        }
                        break;
                    }

                    default: throw new IllegalStateException("wrong code: " + task.code);
                }
                task.recycle();
            }
        } finally {
            mQueueProcessed = false;
        }
    }
private void processTaskQueue() {
        mQueueProcessed = true;
        try {
            Task task;
            while((task = mTaskQueue.poll()) != null) {
                switch (task.code) {

                    case Task.CODE_FIRE_EVENT: {
                        Object event = task.event;
                        final Class<? extends Object> clazz = event.getClass();
                        fire(clazz, event, StateHandler.STATE_ANY);
                        fire(clazz, event, mCurrentState);
                        break;
                    }

                    case Task.CODE_TRANSITION: {
                        int state = task.state;
                        if (mCurrentState != state) {
                            fire(OnExit.class, null, StateHandler.STATE_ANY);
                            fire(OnExit.class, null, mCurrentState);
                            mCurrentState = state;
                            if (mTraceTag != null) {
                                log("new state", null);
                            }
                            fire(OnEntry.class, null, StateHandler.STATE_ANY);
                            fire(OnEntry.class, null, mCurrentState);
                        }
                        break;
                    }

                    default: throw new IllegalStateException("wrong code: " + task.code);
                }
                task.recycle();
            }
        } finally {
            mQueueProcessed = false;
        }
    }
-- implementation