I know how to create a reference to a method that has a String parameter and returns an int, it\'s:
Function
I will do something generic:
public interface Lambda {
@FunctionalInterface
public interface CheckedFunction {
T get() throws Exception;
}
public static T handle(CheckedFunction supplier) {
try {
return supplier.get();
} catch (Exception exception) {
throw new RuntimeException(exception);
}
}
}
usage:
Lambda.handle(() -> method());