function reference to void function java code example
Example: java function without return
//The Function type is declared as
interface Function<T,R> {
R apply(T t);
}
//And the Consumer type is declared as
interface Consumer<T> {
void accept(T t);
}
//Consumer is compatible with methods that receive
//a T and return nothing (void).