ExceptionUtils { public static <T, E extends Exception> T uncheck(SupplierWithExceptions<T, E> supplier) { try { return supplier.get(); } catch (Exception e) { throwAsUnchecked(e); return null; } } private  ExceptionUtils(); static T uncheck(SupplierWithExceptions<T, E> supplier); static Supplier<T> rethrowSupplier(SupplierWithExceptions<T, E> supplier);  }
@Test public void uncheckRethrowsException() throws Exception { expected.expect(MalformedURLException.class); expected.expectMessage("no protocol: not_existing_url"); uncheck(() -> new URL("not_existing_url")); }
@Test public void uncheckWrapsException() throws Exception { assertEquals(new URL("http: }