Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 479 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 479 Bytes

expressions

Playing with Java8. Here's Try as an Expression. More Examples

    @Test public void should_return_try_value() {
        String result = Try(() -> {
            return "try";
        }).Catch(NullPointerException.class, e -> {
            return "catch";
        }).apply();

        assertEquals("try", result);
    }