assertEquals behavior with objects

The Javadocs at JUnit.org do not give you a lot of information on how the methods behave. For example, when calling assertEquals and passing in two objects, does the method "under the covers" call the equals method (if any) for those objects to compare them? I don't think it simply compares object references ... but I could be wrong.

So is it OK to do this:

assertEquals("14:23:33", formatTimeVar);

or should one do this to be "safe":

boolean result = formatTimeVar.equals("14:23:33");
assertTrue(result);

Yes, it calls the equals

Yes, it calls the equals method. If you feel there's a documentation bug, please raise an issue at

http://sourceforge.net/projects/junit/