class Test { interface I { void foo() throws E; } static class Ex extends Exception {} void bar(I s) throws E { s.foo(); } void baz(I s) throws Ex { bar(() -> { try { s.foo(); } catch (Throwable t) { throw t; } }); bar(() -> s.foo()); } }