title: HashMap with byte array key and String value - containsKey() function doesn't work
body: <p>I'm using a HashMap: byte[] key and String value. But I realize that even I put the same object (same byte array and same string value) by using</p>
  
  <pre><code>myList.put(TheSameByteArray, TheSameStringValue)
  </code></pre>
  
  <p>into HashMap, the table still inserts a new object with different HashMapEntry. Then function containsKey() cannot work.</p>
  
  <p>Can someone explains this for me? How can I fix this? Thanks. (Android Java)</p>
  
  <pre><code>@Override public boolean containsKey(Object key) {
      if (key == null) {
          return entryForNullKey != null;
      }
  
      int hash = Collections.secondaryHash(key);
      HashMapEntry&lt;K, V&gt;[] tab = table;
      for (HashMapEntry&lt;K, V&gt; e = tab[hash &amp; (tab.length - 1)];
              e != null; e = e.next) {
          K eKey = e.key;
          if (eKey == key || (e.hash == hash &amp;&amp; key.equals(eKey))) {
              return true;
          }
      }
      return false;
  }
  </code></pre>