Okay, often I’ll have a method that returns a Set of some sort. The problem with unit testing such a method is that there is no guarantee an iteration over the set will always return the items in the same order.
Does anyone have any preferred method of validating a Set?
Peter
Just put your expected values in a Set and then use assertEquals on the expected and actual set. That works a charm, e.g.