Testing tips

How to mock an iterator ?

Mocking an iterator is a little bit special since it uses dynamic hasNext() and next() methods. Different approaches can be used to do this but here 2 of them are described. The first method uses t...

Continue Reading →