added callback method to register callback to transition.
added test of callback method.