I do

. Mockito uses the Hamcrest matchers. When you say which objects you expect to pass in as parameters, it calls equals() on the object ot determine if they are equivalent.
Before, you were using Object equals() implementation. Which checked if they were the same object. Since they weren't, Mockito didn't recognize them as being the same. Once you added the equals() implementation, Mockito saw them as the same and the tests behaved as you expected.