When using the DelayQueue of Java, should I implement equals() and hashCode() as well?
问题 I'm currently dealing with a class that's using a DelayQueue . I've noticed that since the objects in the DelayQueue implement the Delayed interface, the said objects need to implement a compareTo() method as well, which has already been done. Does this implicitly mean that I also should consider implementing an equals() method and a hashCode() method as well? The reason why I'm asking is because I stumbled upon this advice when searching through the project via FindBugs, and I'm trying to