// "Replace with lambda" "true-preview" import java.util.function.Supplier; class A { public T runReadAction( final Supplier computation) { return null; } public T runReadAction( ThrowableComputable computation) throws E { return null; } { runReadAction(new Supplier() { @Override public String get() { return ""; } }); } } @FunctionalInterface interface ThrowableComputable { T compute() throws E; }