java function without return

Java
//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).
Source

Also in Java: