title: Comparing two digested md5 strings returns false
body: <p>I have two md5 hash password that are the same and should return true using the MessageDigest.isEqual method. However the comparison returns false.</p>
  
  <p>When using Array.toString to print the byte-Arrays, they are identical. It still doesn't work, neither for Arrays.euqals nor for MessageDigest.isEqual.</p>
  
  <pre><code>public boolean verifyUserCredentials(String username, MessageDigest password) {
  
          ListIterator&lt;User&gt; iterator = userList.listIterator();
          while (iterator.hasNext()) {
              User user = iterator.next();
              byte md1[] = user.getPassword().digest();
              byte md2[] = password.digest();
              if (user.getUsername() == username &amp;&amp; MessageDigest.isEqual(md1, md2)) {
                  return true;
              } 
          }
          return false;
      }
  </code></pre>