import java.io.IOException; import java.io.UncheckedIOException; import java.util.function.Function; class Main { public static void main(String[] args) { runTest(Main::test, UncheckedIOException:: new); } private static void test() throws IOException {} private static void runTest(A a, Function b) { } @FunctionalInterface public interface A { void foo() throws E; } }