I know that == has some issues when comparing two Strings. It seems that String.equals() is a better approach. Well, I\'m doing JUni
==
Strings
String.equals()
The JUnit assertEquals(obj1, obj2) does indeed call obj1.equals(obj2).
assertEquals(obj1, obj2)
obj1.equals(obj2)
There's also assertSame(obj1, obj2) which does obj1 == obj2 (i.e., verifies that obj1 and obj2 are referencing the same instance), which is what you're trying to avoid.
assertSame(obj1, obj2)
obj1 == obj2
obj1
obj2
So you're fine.