import org.junit.Test;
import java.util.*;
import java.util.stream.Collectors;
/**
* Created by shaozhiqi on 2019/9/26
*/
public class testLam {
@Test
public void testCreateThread() {
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
System.out.println("用匿名内部类的方式来创建线程");
}
});
Thread thread2 = new Thread(() -> {
System.out.println("使用Lambda来创建线程");
});
thread1.start();
thread2.start();
//执行结果:
//用匿名内部类的方式来创建线程
//使用Lambda来创建线程
}
//stream() ? 串行流处理
//parallelStream() - 并行流处理
@Test
public void testSteam() {
Map map1 = new HashMap();
map1.put("age", 20);
map1.put("name", "shaozhiqi");
map1.put("company", "A公司");
Map map2 = new HashMap();
map2.put("age", 21);
map2.put("name", "qqq");
map2.put("company", "B公司");
Map map3 = new HashMap();
map3.put("age", 19);
map3.put("name", "bbb");
map3.put("company", "B公司");
Map map4 = new HashMap();
map4.put("age", 25);
map4.put("name", "LLL");
map4.put("company", "C公司");
List