In JUnit 4, if you use the version of assertEquals that compares two objects, and those objects happen to be subclasses of Number, the framework converts them to long before comparing them. This is broken for any non-integral type since it will neglect the fractional part.
Just to make matters worse, if you attempt to compare two floating point numbers using assertEquals and you forget to add the 'delta' argument, then once again you will get the object-version of the method and the comparison will be invalid. This is a regression from the old JUnit which predated auto-boxing and the compiler would moan about mismatched argument types. It is hard to believe, but this unit test passes:
@Test
public void test() {
assertEquals(1.2, 1.3);
}