Runnable runnable = new Runnable() {
@Override
public void run() {
throw new RuntimeException("You cannot Pass!");
}
};
Lets say I have a runnable like the one mentioned above. IntelliJ reports that all anonymous classes can be replaced by lambdas as of Java 8.
Can somebody help me out with the correct syntax.
Function that needs to be called with the runnable as parameter:
public void intercept(Runnable runnable) { ... }
PS: As to why somebody would need a runnable like that is not the question here, thank you