Advanced Mockito: Argument Captors, Spies, Answers, and Mocking Pitfalls

Most Java developers know exactly one Mockito incantation: when(x).thenReturn(y). It's the first thing you learn and, for many, the last…