newMap = new LinkedHashMap<K, V>();
List<Map.Entry<K, V>> entries = new ArrayList<Map.Entry<K, V>>();
for (Map.Entry entry : map.entrySet()) {
entries.add(new SimpleMapEntry(entry.getKey(), entry.getValue()));
}
EntryComparator entryComparator = new EntryComparator(comparator, comparatorStyle);
Collections.sort(entries, entryComparator);
for (Map.Entry<K, V> entry : entries) {
newMap.put(entry.getKey(), entry.getValue());
}
} else {