void () { doTest(""" class Exc { Object apply() { try { return foo(); } catch (Throwable t) { throw throwChecked(t); } } \s native Object foo() throws Exception; \s @SuppressWarnings("unchecked") private static <T extends Throwable> RuntimeException throwChecked(Throwable t) throws T { throw (T) t; } } """); }