Mockito.verify()



Mockito rememebers all the interactions happened with the mock object.
You can verify any interaction using the Mockito.verify().
Example:
ArrayList<String> list =  Mockito.spy(ArrayList.class);
list.add("good");
list.add("morning");

Mockito.verify(list).add("morning");
Mockito.verify(list).add("good");

Here it will verify the .add("morning") and .add("good") is called or not