//取result
List<Map> dList = asStepList.stream().map(this::resultKey).collect(Collectors.toList());
//根据keyname分组
Map<String, List<Map>> gbList = dList.stream().collect(Collectors.groupingBy(map -> String.valueOf(map.get("keyname"))));
//根据keymax值取最大的
List<Map> result = new ArrayList<Map>();
for(Map.Entry<String, List<Map>> entry : gbList.entrySet()) {
List<Map> mapValue = entry.getValue();
Collections.sort(mapValue, (o1, o2) -> Integer.valueOf(o2.get("keymax").toString()) - Integer.valueOf(o1.get("keymax").toString()));
result.add(CollectionUtils.isEmpty(mapValue.get(0)) ? null : mapValue.get(0));
}
private Map resultKey(Map<String, Object> map){
return (Map) map.get("result");
}