I was learning mockito and I understood the basic usages of the above mentioned functions from the link.
But I would like to know whether it can be used for any othe
To add a bit to accepted answer ...
If you get an UnfinishedStubbingException, be sure to set the method to be stubbed after the when closure, which is different than when you write Mockito.when
Mockito.doNothing().when(mock).method()    //method is declared after 'when' closes
Mockito.when(mock.method()).thenReturn(something)   //method is declared inside 'when'