code: public static <K, V> Map<K, V> sortByValue(Map<K, V> map, BeanComparator beanComparator)
  	{
  		return map.entrySet()
  		.stream()
  		.sorted(Map.Entry.comparingByValue(beanComparator))
  		.collect(Collectors.toMap(
  		Map.Entry::getKey,
  		Map.Entry::getValue,
  		(e1, e2) -> e1,
  		LinkedHashMap::new));
  	}
docs: --------------------------------------------