Pre Merge pull request !204 from 抓蛙师/auto-7465549-dev-1657950299488

This commit is contained in:
抓蛙师 2022-07-16 05:45:00 +00:00 committed by Gitee
commit fd4d0e98b1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -124,8 +124,8 @@ public class StreamUtils {
return MapUtil.newHashMap(); return MapUtil.newHashMap();
} }
return collection return collection
.stream() .stream()
.collect(Collectors.groupingBy(key, Collectors.toList())); .collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
} }
/** /**
@ -146,7 +146,8 @@ public class StreamUtils {
} }
return collection return collection
.stream() .stream()
.collect(Collectors.groupingBy(key1, Collectors.groupingBy(key2, Collectors.toList()))); .collect(Collectors.groupingBy(key1, LinkedHashMap::new,
Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
} }
/** /**
@ -167,7 +168,8 @@ public class StreamUtils {
} }
return collection return collection
.stream() .stream()
.collect(Collectors.groupingBy(key1, Collectors.toMap(key2, Function.identity(), (l, r) -> l))); .collect(Collectors.groupingBy(key1, LinkedHashMap::new,
Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
} }
/** /**