Comparing two Classes using the equality operator
<p>What are the pitfalls of comparing Class instances using the equality operator?</p>

<pre><code>boolean compareTypes(Class&lt;?&gt; clazz, Class&lt;?&gt; rootClazz) {
    return clazz == rootClazz;
}
</code></pre>
