This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I just used the Comparator the way Dmitry described. It's not simple to understand at first, i.e. takes some reading and study (in the javadocs and looking at some simple examples), but it's very powerful once you get the hang of it.
A google search on "Comparator" will probably find you what you need.