@Test public void test() { AnoaHandler<Meta> handler = AnoaHandler.withFn(t -> (t instanceof RuntimeException) ? Meta.RUNTIME : Meta.OTHER); Assert.assertNotNull(handler.empty()); Assert.assertEquals("derp", handler.of("derp").get()); ListAssert.assertEquals( Collections.singletonList(Meta.RUNTIME), handler.handle(new AnoaJacksonTypeException("hello")).collect(Collectors.toList())); }