Exceptions { public static RuntimeException sneakyThrow(Throwable t) { return Exceptions.<RuntimeException>doThrow(t); } private  Exceptions(); static RuntimeException sneakyThrow(Throwable t);  }
@Test public void testCastOfException(){ Exception exception = new IOException("simulated checked exception message"); try{ Exceptions.sneakyThrow(exception); fail(); } catch(Exception e){ assertTrue(e instanceof IOException); } }