@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Deprecated other = (Deprecated) obj; if (deprecatedDate == null) { if (other.deprecatedDate != null) return false; } else if (!deprecatedDate.equals(other.deprecatedDate)) return false; if (primaryRecord == null) { if (other.primaryRecord != null) return false; } else if (!primaryRecord.equals(other.primaryRecord)) return false; return true; }