I have a Consumer that I\'d like to convert into a Function.
Consumer
Function
I could achieve that by using
public
A standard way doesn't exist, but this should do the trick:
Function adapt(final Consumer consumer) { return t -> { consumer.accept(t); return null; }; }
This is following the Adapter Pattern mentioned in the accepted answer from @rgettman.