//供给型接口
Supplier supplier = ()->new Integer(1);
System.out.println(supplier.get());
//消费型接口
Consumer<Integer> consumer = a -> System.out.println(a);
consumer.accept(1);
//断言型接口
Predicate predicate = str-> "A".equals(str);
System.out.println(predicate.test("s"));
System.out.println(predicate.test("A"));
//函数型接口
Function<Integer,String> function = i -> String.valueOf(i);
System.out.println(function.apply(3));
BiFunction<Integer,Long,String> biFunction = (a,b)->String.valueOf(a+b);
System.out.println(biFunction.apply(4,5L));
输出结果为: