Mocking complex behavior with Mockito's doAnswer()
and ArgumentCaptor
can quickly get messy.
But creating test doubles for interfaces that have many methods requires a lot of boilerplate and
increases maintenance overhead.
This code allows you to create a test double without implementing a common interface with the class to be mocked.