java8 内置的四大核心函数式接口
Consumer<T> : 消费型接口
void accept(T t);
Supplier<T> : 供给型接口
T get();
Function<T,R> : 函数型接口
R apply(T t);
Predicate<T> : 断言型接口
boolean test(T t);
创建Stream
1.Collection系列集合提供的steam()或parallelStream()
List<String> list = new ArrayList<>();
Stream<String> stream1 = list.stream();
2.Array的静态方法stream()获取数组流
Employee[] emps = new Employee[10];
Stream<Employee> stream = Arrays.stream(emps);
3.Stream类的静态方法 of()
Stream<String> stream = Stream.of("aa","bb","cc","dd");
4.创建无限流
迭代
Stream<Integer> stream = Stream.iterate(0,x->x+2);
stream.limit(10).forEach(System.out::println</