根据后缀区分即可,Bi开头接口名均为双参数方法。
/**无参无返回值*/
Runnable runnable = () -> {};
/**生产者:无参有返回值*/
Supplier supplierRef = Object::new;
Supplier supplier = () -> "";
/**消费者:有参无返回值*/
Consumer consumerRef = Object::notify;
Consumer consumer = (Object a) -> {};
BiConsumer biConsumer = (Object a, Object b) -> {};
/**谓词:有参返回boolean*/
Predicate predicateRef = Objects::isNull;
Predicate predicate = (Object a) -> true;
BiPredicate biPredicate = (Object a, Object b) -> true;
/**函数:有参有返回值,Operator结尾均属于Function类型*/
Function functionRef = Object::toString;
Function function = (Object a) -> a;
BiFunction biFunction = (Object a, Object b) -> a;