In this recipe, we will stub a void method that doesn't return a value. The trick with void methods is that Mockito assumes that they do nothing by default, so there is no need to explicitly stub them (although you may do it).
If you do not want your void method to execute logic, you need to perform the following steps:
BDDMockito.willNothing().given(mock).methodToStub(), or in the standard way, call
when(...)method, you have to provide the mock object (and ...