You can use the descendingMap call to get the view on the map, which is basically in the reverse order, and then take the first 24 entries from that (call iterator , etc.). ( Guava Iterables provides useful methods to limit iterable, etc.)
EDIT: for example, to get the last 24 elements (in reverse order and using Guava), you can use:
List<HashMap<Type, Double>> lastValues = Lists.newArrayList (Iterables.limit(map.descendingMap().values(), 24));
source share