Let\'s say i have the following psuedo like test code:
//Let\'s import Mockito statically so that the code looks clearer
import static org.mockito.Mockito.*;
It asserts that the method was called, and with those arguments.
Comment out:
//mockedList.add("one");
Or change its argument and the test will fail.
Mockito.verify(MockedObject).someMethodOnTheObject(someParametersToTheMethod);
verifies that the methods you called on your mocked object are indeed called. If they weren't called, or called with the wrong parameters, or called the wrong number of times, they would fail your test.