1、根据key排序
Map<String,String> result = new HashMap<>();
Map<String,String> map = new HashMap<>();
().stream()
.sorted(())
.forEachOrdered(x->((),()));
2、根据value排序
Map<String, Integer> valueResult = new HashMap<>();
Map<String, Integer> map = new HashMap<>();
().stream()
.sorted(
.comparingByValue())
.forEachOrdered(b->((), ()));