title: Comparing Class objects
body: <p>I have to compare a <code>Class</code> object against a list of pre-defined classes.</p>
  
  <p>Is it safe to use <code>==</code> or should I use <code>equals</code>? </p>
  
  <pre><code>if        (klass == KlassA.class) {
  } else if (klass == KlassB.class) {
  } else if (klass == KlassC.class) {
  } else {
  }
  </code></pre>
  
  <p><strong>Note:</strong> I cannot use <code>instanceof</code>, I don't have an object, I just have the <code>Class</code> object. I (mis)use it like an enum in this situation!</p>