Replaced use of Set.descendingIterator() with Java 1.5 compatible functions