Wow, I'm trying to figure out how to do even an not-so-efficient implementation.. I still don't have it... is the case I stated too complicated to understand? Should I explain better? I know the cache should somehow be sorted first.. and that could be done using comparable, but to resolve the second criteria is bit difficult...