mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
将增强流中的部分通用方法分离为接口中的默认方法
This commit is contained in:
@@ -6,6 +6,7 @@ import org.junit.Test;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -327,7 +328,7 @@ public class EntryStreamTest {
|
||||
Map<Integer, Integer> result = EntryStream.of(map).toMap();
|
||||
Assert.assertEquals(map, result);
|
||||
|
||||
result = EntryStream.of(map).toMap(LinkedHashMap::new);
|
||||
result = EntryStream.of(map).toMap((Supplier<Map<Integer, Integer>>)LinkedHashMap::new);
|
||||
Assert.assertEquals(new LinkedHashMap<>(map), result);
|
||||
|
||||
result = EntryStream.of(map).toMap(LinkedHashMap::new, (t1, t2) -> t1);
|
||||
|
Reference in New Issue
Block a user