class Test { interface F { void m(T t) throws T; } void foo(F f) throws K { } { foo((t)->{}); foo((ClassNotFoundException t)->{}); } }