Kind of :)
I read the release notes and indeed the information is misleading. You
cannot verify toString() but you can stub it:
ToStringDelegationTest delegate = new ToStringDelegationTest();
Object mockMyObject = Mockito.mock(Object.class);
stub(mockMyObject.toString()).toReturn("foo");
delegate.setMyObject(mockMyObject);
assertEquals("foo", delegate.toString());
Verification of toString() is not possible because:
1. When I debug my IDE calls toString() on objects to print local
variables and their content, etc. After debugging, the verification of
toString() will most likely fail.
2. toString() is used for logging or during string concatenation.
Those invocations are usually irrelevant but they will change the
outcome of verification.
Cheers,
Szczepan Faber