diff --git a/commons/common-util/src/main/java/com/schbrain/common/util/StreamUtils.java b/commons/common-util/src/main/java/com/schbrain/common/util/StreamUtils.java index 7562273c16e323449f31cbac6ccbc99eafd4054b..fa33a1159dee6aac449bcb127f6795d83672875d 100644 --- a/commons/common-util/src/main/java/com/schbrain/common/util/StreamUtils.java +++ b/commons/common-util/src/main/java/com/schbrain/common/util/StreamUtils.java @@ -88,11 +88,7 @@ public class StreamUtils { } public static > Map toMap(Iterable data, Function keyMapper, Function valueMapper, Supplier mapFactory) { - return from(data).collect(Collectors.toMap(keyMapper, valueMapper, (oldValue, newValue) -> { - // Could not get the key when mergeFunction invoke - log.warn("There are multiple values with the same key when toMap, return the old one"); - return oldValue; - }, mapFactory)); + return from(data).collect(Collectors.toMap(keyMapper, valueMapper, (oldValue, newValue) -> oldValue, mapFactory)); } public static Map> groupBy(Iterable data, Function mapper) { @@ -156,4 +152,4 @@ public class StreamUtils { return StreamSupport.stream(source.spliterator(), parallel); } -} +} \ No newline at end of file