title: Is Java's assertEquals method reliable?
body: <p>I know that <code>==</code> has some issues when comparing two <code>Strings</code>.  It seems that <code>String.equals()</code> is a better approach.  Well, I'm doing JUnit testing and my inclination is to use <code>assertEquals(str1, str2)</code>.  Is this a reliable way to assert two Strings contain the same content?  I would use <code>assertTrue(str1.equals(str2))</code>, but then you don't get the benefit of seeing what the expected and actual values are on failure.</p>
  
  <p>On a related note, does anyone have a link to a page or thread that plainly explains the problems with <code>str1 == str2</code>?</p>