Maps and HashMap Internals

What a hash map does with a key, and what it costs when two keys collide.