If JUnit 4 (or greater) is in the classpath, failures of
isEqualTo(String)inStringAssertisEqualTo(Object)inObjectAssert
will throw ComparisonFailure instead of the default AssertionError.
This feature can be useful when using tools that have special support for this exception. For example, Eclipse provides a nice GUI that shows the differences between the expected and actual String values:
Labels: