No code is shown, so these are only guesses.
First, as mentioned, the elements of your Set
s don't implement .equals()
/.hashCode()
.
Second, you use assertEquals()
on Collection
s: many test frameworks (TestNG for instance), when faced with Collection
s as arguments, will succeed if and only if the two collections have the same elements in the same order. Use another method, such as, for instance, assertEqualsNoOrder-)
-- but here this is complicated by the fact that you have embedded Collection
s. Or just use assertTrue(coll1.equals(coll2))
.