containsKey()
uses the .equals()
method which you don't seem to override. .hashCode()
provides a normalized (ideally) distribution across the hashtable, it does not do any equality comparisons (aside from requiring two equal objects require the same hashcode).
As you can see in the source code:
if (e.hash == hash && ((k = e.key) == key || (key != null && key.equals(k))))