Java tutorial
//package com.java2s; import java.util.LinkedHashMap; public class Main { @SuppressWarnings("unchecked") static public LinkedHashMap invertOrdering(LinkedHashMap passedMap) { LinkedHashMap result = new LinkedHashMap(); Object[] keys = passedMap.keySet().toArray(); for (int i = keys.length - 1; i >= 0; i--) result.put(keys[i], passedMap.get(keys[i])); return result; } }