diff --git a/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java b/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java index 08a5e20b40..7beb75632e 100644 --- a/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java +++ b/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java @@ -216,11 +216,11 @@ public class VavrUnitTest { assertEquals(-1, errorSentinel); } - // @Test(expected = ArithmeticException.class) - // public void givenBadCode_whenTryHandles_thenCorrect3() { - // Try result = Try.of(() -> 1 / 0); - // result.getOrElseThrow(ArithmeticException::new); - // } + @Test(expected = RuntimeException.class) + public void givenBadCode_whenTryHandles_thenCorrect3() { + Try result = Try.of(() -> 1 / 0); + result.getOrElseThrow(e->new RuntimeException(e));//re-throw different ex type + } // lazy @Test