- @Test(expected = InterruptedException.class)
- public void testThrowableOrElseThrow() throws InterruptedException {
- final String foo = "foo";
- final Exception cause = new NullPointerException(foo);
- CheckedValue.ofException(cause).orElseThrow((Supplier<InterruptedException>)InterruptedException::new);
+ @Test
+ public void testThrowableOrElseThrow() {
+ final CheckedValue<?, ?> value = CheckedValue.ofException(new NullPointerException("foo"));
+ final Exception mock = mock(Exception.class);
+ assertThrows(mock.getClass(), () -> value.orElseThrow(() -> mock));