@everett-toews I believe a Comparator suffices:

https://gist.github.com/andrewgaul/6109765