I am writing Unit test using Junit 4 to compare two List I have two lists of tuples of type java.util.List
The tuple order can be different inside the List. I would like to compare these two Lists.
What i have done
assertEquals(new HashSet(List1), new HashSet(List2));
Assertion is failing saying
junit.framework.AssertionFailedError:
Expected :[2 second 38.46 162.417 361.583 112.331, 1 first 157.577 154.985 135.126 171.198]
Actual :[2 second 38.46 162.417 361.583 112.331, 1 first 157.577 154.985 135.126 171.198]
I can't see any difference between two, how to compare this?
Edit: Even I am comparing like
assertEquals(expectedCanonmap, getOutput(out));
it is saying
junit.framework.AssertionFailedError:
Expected :[1 first 157.577 154.985 135.126 171.198, 2 second 38.46 162.417 361.583 112.331]
Actual :[1 first 157.577 154.985 135.126 171.198, 2 second 38.46 162.417 361.583 112.331]