AbsoluteDate.equals method failing for different infinity instances
When asserting equality between two instances of PAST_INFINITY or FUTURE_INFINITY, AbsoluteDate.equals method returns wrong value, as in :
final AbsoluteDate date1 = new AbsoluteDate(AbsoluteDate.PAST_INFINITY, 0);
final AbsoluteDate date2 = new AbsoluteDate(AbsoluteDate.PAST_INFINITY, 0);
Assert.assertEquals(date1, date2);
This is because in the AbsoluteDate.equals method, the check for separate AbsoluteDate instances is done by calling AbsoluteDate.durationFrom, which returns NaN in this case because instances offsets are infinities.
One possibility for solving this bug would be to add a dedicated test:
if ((this.offset == -Infinity & date.offset == -Infinity) |
(this.offset == Infinity & date.offset == Infinity)) {
return true;
}