I have a Map, and a list of objects from the database with an effectiveDate property, and I want to check to see
Part 1: "Shouldn't equals agree with compareTo?*
No; compareTo should agree with equals, but the reverse is irrelevant.
compareTo is about sorting order. equals is about equality. Consider race cars, that may be sorted by fastest lap time in practice to determine starting position. Equal lap times does not mean they are the same car.
Part 2: Equal dates.
Database calls will return a java.sql.Date, which although it is assignable to java.util.Dare, because it extends that, will not be equal, because the class is different.
A work around may be:
java.util.Date test;
java.sql.Date date;
if (date.equals(new java.sql.Date(test.getTime()))