publicstaticvoidmain(String[] args){
People people3 =functionMethod(person, p ->{
People people2 =constructor(People::new);
people2.setName(p.getName());
people2.setSex(p.getSex());return people2;});}/**
* Function 函数是接口,有参数,有返回值
*
* @param t T
* @param function Function
* @return R
*/publicstatic<T, R> R functionMethod(T t, Function<T, R> function){return function.apply(t);}/**
* BiFunction 函数是接口,有参数,有返回值
*
* @param t T
* @param u U
* @param biFunction BiFunction
* @param <T> T
* @param <U> U
* @param <R> R
* @return R
*/publicstatic<T, U, R> R biFunctionMethod(T t, U u, BiFunction<T, U, R> biFunction){return biFunction.apply(t, u);}/**
* Consumer 消费型接口,有参数,无返回值
*
* @param person Person
* @param consumer Consumer
*/publicstaticvoidconsumerMethod(Person person, Consumer<Person> consumer){
consumer.accept(person);}/**
* Consumer 消费型接口,有参数,无返回值
*
* @param person Person
* @param people People
* @param biConsumer BiConsumer
*/publicstaticvoidbiConsumerMethod(Person person, People people, BiConsumer<Person,>People> biConsumer){
biConsumer.accept(person, people);}