title: How to test a hash function?
body: <p>Is there a way to test the quality of a hash function? I want to have a good spread when used in the hash table, and it would be great if this is verifyable in a unit test.</p>
  
  <p><strong>EDIT</strong>: For clarification, my problem was that I have used <code>long</code> values in Java in such a way that the first 32 bit encoded an ID and the second 32 bit encoded another ID. Unfortunately Java's hash of long values just XORs the first 32 bit with the second 32 bits, which in my case led to very poor performance when used in a <code>HashMap</code>. So I need a different hash, and would like to have a Unit Test so that this problem cannot creep in any more.</p>