The javadoc for EasyMock.andVoid() read's as follows
Records a call but returns nothing. Used to chain calls on void methods expectLastCall().andThrow(e).andVoid()
Returns:
this object to allow method call chaining.lockquote
Do you know any possible situation in which one needs this? What is the purpose of andVoid() in the above example?
Let us consider:
myMock.myMethod();
expectLastCall().andVoid().andThrow(e)
With myMethod having return type void. Then we could just omit the 'chain-element' andVoid.