Tip #9: Mockito
Mockito is arguably the most popular of the second generation Java mocking frameworks. Its fluent interface and the way it does away with an explicit expectation phase by verifying directly on the expected interactions with the collaborators of the subject under test gives it an edge over earlier frameworks like JMock and Easymock .
Here’s a test from the GOOS book, written using JMock:
