When I test this code:
java.util.Date date = new java.util.Date();
java.util.Date stamp = new java.sql.Timestamp(date.getTime());
assertTrue(date.equals(sta
date.equals(stamp) return true AND stamp equals(date) returns false. REASON :Date neglects the nanosecond part of timestamp and since the other parts happen to be equal so the result is equal. The fractional seconds - the nanos - are separate.The Timestamp.equals(Object) method never returns true when passed a value of type java.util.Date because the nanos component of a date is unknown. See here for more details