Is it possible (In Java) to create a Map where, no matter what key I was to search for, I would retrieve the same value? We can assume either a finite or infinite amount of keys.
I considered a map of size 1 and load factor of 1.0, with that value stored in it, but I'm nearly positive that the hashmap implementation will recognize the collision, and return null anyway.
I also entertained the possibility that if I created my own hashfunction for a variable, or even a new datatype that implemented Map, that I should be able to do this, but it may be a little messy. Perhaps not?
Of course, simply mapping the value to every single key would be very inefficient (unless there is a built in method for this, that I overlooked), and nowhere near as entertaining as hearing SO's answers.