how to mock void code example Example: java doreturn void doNothing().when(yourMock).yourMockedMethod();