 <p>If you did want to whitelist for performance reasons, consider using an annotation to indicate which fields to compare. Also, this implementation won't work if your fields don't have good implementations for <code>equals()</code>.</p> <p>P.S. If you go this route for <code>equals()</code>, don't forget to do something similar for <code>hashCode()</code>.</p> <p>P.P.S. I trust you already considered <a href="http://commons.apache.org/lang/api/org/apache/commons/lang/builder/HashCodeBuilder.html" rel="nofollow noreferrer">HashCodeBuilder</a> and <a href="http://commons.apache.org/lang/api/org/apache/commons/lang/builder/EqualsBuilder.html" rel="nofollow noreferrer">EqualsBuilder</a>.</p>