I\'m trying to test some legacy code, using Mockito.
I want to stub a FooDao that is used in production as follows:
FooDao
foo = fooDao.getBar(
http://site.mockito.org/mockito/docs/1.10.19/org/mockito/Matchers.html
anyObject() should fit your needs.
anyObject()
Also, you can always consider implementing hashCode() and equals() for the Bazoo class. This would make your code example work the way you want.
hashCode()
equals()
Bazoo