通过Entry排序，可以按照键排序，也可以按照值排序，亦或者两者综合排序

@param <K> 键类型
@param <V> 值类型
@param map 被排序的Map
@param comparator {@link Comparator}
@return {@link LinkedList}
@since 3.0.9
517819
public static <K, V> LinkedHashMap<K, V> sortByEntry(Map<K, V> map, Comparator<Map.Entry<K, V>> comparator) {
		return sortToMap(map.entrySet(), comparator);
	}
707844
public static <K, V> V first( NavigableMap<K, V> map ) {
        return map.firstEntry().getValue();
    }
1369761
public static <A, B extends Comparable<B>> Map<A, B> sortByValue(Map<A, B> map) {
    List<Map.Entry<A, B>> list = Lists.newArrayList(map.entrySet());
    Collections.sort(list, new Comparator<Map.Entry<A, B>>() {
      public int compare(Map.Entry<A, B> o1, Map.Entry<A, B> o2) {
        return o1.getValue().compareTo(o2.getValue());
      }
    });
    return listToMap(list);
  }
46971
private static <K, V> ImmutableSortedMap<K, V> of(Comparator<? super K> comparator, K k1, V v1) {
    return new RegularImmutableSortedMap<K, V>(
        new RegularImmutableSortedSet<K>(ImmutableList.of(k1), checkNotNull(comparator)),
        ImmutableList.of(v1));
  }
1294357
public static SortedSet<String> sortedKeys(Map<String, String> map) {
        return new TreeSet<String>(map.keySet());
    }
1234000
private static <K, V> SortedMap<K, V> filterFiltered(
      FilteredEntrySortedMap<K, V> map, Predicate<? super Entry<K, V>> entryPredicate) {
    Predicate<Entry<K, V>> predicate = Predicates.<Entry<K, V>>and(map.predicate, entryPredicate);
    return new FilteredEntrySortedMap<K, V>(map.sortedMap(), predicate);
  }
658546
public static <T, L extends List<T>> L sortThis(L list, Comparator<? super T> comparator)
    {
        if (list instanceof MutableList)
        {
            ((MutableList<T>) list).sortThis(comparator);
        }
        else if (list instanceof ArrayList)
        {
            ArrayListIterate.sortThis((ArrayList<T>) list, comparator);
        }
        else
        {
            if (list.size() > 1)
            {
                Collections.sort(list, comparator);
            }
        }
        return list;
    }
288129
@SuppressWarnings("rawtypes")
    public static <T> List<T> topp(final Collection<? extends T> c, final int fromIndex, final int toIndex, final int n, final Comparator<? super T> cmp) {
        N.checkArgNotNegative(n, "n");

        if (n == 0) {
            return new ArrayList<>();
        } else if (n >= toIndex - fromIndex) {
            if (fromIndex == 0 && toIndex == c.size()) {
                return new ArrayList<>(c);
            } else {
                final List<T> res = new ArrayList<>(toIndex - fromIndex);
                final Iterator<? extends T> iter = c.iterator();
                T e = null;

                for (int i = 0; i < toIndex && iter.hasNext(); i++) {
                    e = iter.next();

                    if (i < fromIndex) {
                        continue;
                    }

                    res.add(e);
                }

                return res;
            }
        }

        final Comparator<Indexed<T>> comparator = cmp == null ? (Comparator) new Comparator<Indexed<Comparable>>() {
            @Override
            public int compare(final Indexed<Comparable> o1, final Indexed<Comparable> o2) {
                return N.compare(o1.value(), o2.value());
            }
        } : new Comparator<Indexed<T>>() {
            @Override
            public int compare(final Indexed<T> o1, final Indexed<T> o2) {
                return cmp.compare(o1.value(), o2.value());
            }
        };

        final Queue<Indexed<T>> heap = new PriorityQueue<>(n, comparator);

        if (c instanceof List && c instanceof RandomAccess) {
            final List<T> list = (List<T>) c;
            Indexed<T> indexed = null;
            T e = null;

            for (int i = fromIndex; i < toIndex; i++) {
                e = list.get(i);

                indexed = Indexed.of(e, i);

                if (heap.size() >= n) {
                    if (comparator.compare(heap.peek(), indexed) < 0) {
                        heap.poll();
                        heap.add(indexed);
                    }
                } else {
                    heap.offer(indexed);
                }
            }
        } else {
            final Iterator<? extends T> iter = c.iterator();
            Indexed<T> indexed = null;
            T e = null;

            for (int i = 0; i < toIndex && iter.hasNext(); i++) {
                e = iter.next();

                if (i < fromIndex) {
                    continue;
                }

                indexed = Indexed.of(e, i);

                if (heap.size() >= n) {
                    if (comparator.compare(heap.peek(), indexed) < 0) {
                        heap.poll();
                        heap.add(indexed);
                    }
                } else {
                    heap.offer(indexed);
                }
            }
        }

        final Indexed<T>[] arrayOfIndexed = heap.toArray(new Indexed[heap.size()]);

        N.sort(arrayOfIndexed, new Comparator<Indexed<T>>() {
            @Override
            public int compare(final Indexed<T> o1, final Indexed<T> o2) {
                return o1.index() - o2.index();
            }
        });

        final List<T> res = new ArrayList<>(arrayOfIndexed.length);

        for (int i = 0, len = arrayOfIndexed.length; i < len; i++) {
            res.add(arrayOfIndexed[i].value());
        }

        return res;
    }
747964
public static <K, V> SortedMap<K, V> nullToEmpty(final SortedMap<K, V> map) {
        return map == null ? N.<K, V> emptySortedMap() : map;
    }
1119849
public static <K, V> String join(Map<K, V> map, String separator, String keyValueSeparator) {
		return join(map, separator, keyValueSeparator, false);
	}
344709
@Deprecated
  public static <K extends Comparable<K>, V> ImmutableMap<K, V> copyWithSortedKeys(
      final Map<K, V> map) {
    return ImmutableSortedMap.copyOf(map);
  }
974901
@Override
    public Iterator<Map.Entry<String, Order>> iterator() {
        return sortOrder.entrySet().iterator();
    }
631833
public static Map<String,String> order(Map<String, String> map){
		HashMap<String, String> tempMap = new LinkedHashMap<String, String>();
		List<Map.Entry<String, String>> infoIds = new ArrayList<Map.Entry<String, String>>(	map.entrySet());

		Collections.sort(infoIds, new Comparator<Map.Entry<String, String>>() {
			public int compare(Map.Entry<String, String> o1,Map.Entry<String, String> o2) {
				return (o1.getKey()).toString().compareTo(o2.getKey());
			}
		});

		for (int i = 0; i < infoIds.size(); i++) {
			Map.Entry<String, String> item = infoIds.get(i);
			tempMap.put(item.getKey(), item.getValue());
		}
		return tempMap;
	}
528318
public static <T> List<T> sort(List<T> list, Comparator<? super T> comparator) {
        Collections.sort(list, comparator);
        return list;
    }
555162
public static <K extends Comparable<? super K>, V> List<Map.Entry<K, V>> sortedEntries(Map<K, V> map) {
    return sortedEntries(map.entrySet());
  }
870597
@NotNull
    public static <K, V> Stream<Map.Entry<K, V>> of(@NotNull Map<K, V> map) {
        Objects.requireNonNull(map);
        return new Stream<Map.Entry<K, V>>(map.entrySet());
    }
268371
private static List<Parameter> convert(Map<String, Object> map) {
		Set<Entry<String, Object>> entries = map.entrySet();
		List<Parameter> parameters = new ArrayList<>(entries.size());
		for (Entry<String, Object> entry : entries) {
			if (entry.getValue() != null) {
				parameters.add(new Parameter(entry.getKey(), entry.getValue().toString()));
			}
		}
		return parameters;
	}