LinkedHashMap倒叙反转
/**
* 将原本的LinkedHashMap反转
*/
private static Map<String, Object> reverse(LinkedHashMap<String, Object> map) {
ListIterator<Map.Entry<String, Object>> i = new ArrayList<>(map.entrySet()).listIterator(map.size());
LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<>();
while (i.hasPrevious()) {
Map.Entry<String, Object> entry = i.previous();
linkedHashMap.put(entry.getKey(), entry.getValue());
}
return linkedHashMap;
}