public interface Callable_Void extends Callable<Void>
Callable<Void>
for void-returning lambda expressions and method references.
Intended usage:
Some APIs accept Callable<Void>
, for example
public static <T> void foo(Callable<T> action)
which, unfortunately, is not compatible with void-returning lambda expressions and method references, for example
foo( ()->System.gc() ); // does NOT compile foo( System::gc ); // does NOT compile
This adapter interface provides a workaround:
foo( (Callable_Void) ()->System.gc() ) foo( (Callable_Void) System::gc )