提交 f7fbfd24 编写于 作者: 武汉红喜's avatar 武汉红喜

lambda

上级 bfbbcc73
......@@ -5,6 +5,7 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.*;
/**
......@@ -37,6 +38,7 @@ public class Test {
System.out.println(map2);
Map<Boolean, List<Task>> map3 = tasks.stream().collect(partitioningBy(e -> e.getPoint() > 7));
System.out.println(map3);
// Map<String, Product> productMap = products.stream().collect(toMap(Product::getSku, identity(), (key1, key2) -> key2));
Collection<String> result = tasks
.stream()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册