Junit test for order in LinkedHashSet

Viewed 1130

I'm attempting to write a Junit test which should test if the order of elements in two LinkedHashSets are the same. The follwoing is my existing code:

Assert.assertEquals(
            Sets.newLinkedHashSet(Arrays.asList("a","d","c","b")),
            conf.getSetInfo()
    );  

This test is successful even if I give it compares a,d,c,b against a,b,c,d and thus not considering the ordering of elements. How can I go about asserting based on the ordering?

1 Answers
Related