I found this article to be very informative in comparison of old-style functions to new Java-8 lambda-functions and parallel processing. One thing I couldn\'t quite understand w
Derived from @Alex's answer:
@FunctionalInterface
public interface SelfRunnable extends Runnable {
public void run(SelfRunnable this_);
@Override
public default void run() {
run(this);
}
public static Runnable runnable(SelfRunnable runnable) {
return runnable;
}
}
public interface Test {
public static void main(String... arguments) {
final Runnable r = SelfRunnable.runnable(this_ -> this_.run());
r.run();
}
}