Android/Testing/Unit Testing/Monitor supermethods

Some monitoring behaviour is common: Activities can start other activities, for instance, and testing those calls involves recording the intents issued during the test. Robolectric offers this behaviour with its ShadowContextWrapper.getNextActivity, but the following may be a more useful strategy in certain circumstances.

Code under test
Activity that starts another activity.

Test
Extend the activity under test, overriding the startActivity method:

Misc
This is a wrapping-up of being able to monitor an activity: