org.jboss.mq.server.MessageReference does override equals() (and even compareTo()), but not hashCode().
This is a potential issue, when adding MessageReferences to hashCode-based Collections such as Hashmap or HashSet.
If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
Will append a patch.
Came across this when searching for the root of a symptom, where messages were processed and removed from the MessageCache, but still were persistent in database - don't know yet if it's related.