spullara/redis-protocol — pull request #41 by stevenschlansker (2014-07-10 19:31:48+00:00)
Title: Remove horribly hacky getRandomKey implementation

* Relies on implementation of all Map objects to be HashMap
* Relies on implementation details of HashMap which changed for Java 8, so the code no longer works
* Very poor randomness - because it selects a bucket first, colliding hashcodes will cause elements to be selected with dramatically reduced frequency

Biggest downside is selecting a random element is now `O(N)`. Most unfortunate, but a slower working solution is better than a broken fast one...