Also, the tag is [code], not [javadoc]. I've modified it for you and split it into two code blocks.
Right, now to the answer. HashMap uses the hash code of the key to find the appropriate bucket to put the object in. If you then modify the object in such a way that its hash code changes, if you use that object to look for the value the HashMap will look in the wrong bucket. It can't find the key in there, so it returns null. In short, you should not use mutable objects as keys for any map, unless:
a) the hash code itself is immutable (e.g. you can change the object, just not its hash code).
b) you make very, very sure that you don't change the object while it's a key in the map.
This is why String, Integer and Long are favourites as map keys - they are immutable; once created, the hash code will never change anymore.