    @Test
    public void testMapResult() {

        val promise = Promise.ofException(new IOException());
        assertEquals (PromiseStatus.COMPLETED,                     promise.getStatus());
        assertStrings("Result:{ Exception: java.io.IOException }", promise.getCurrentResult());
        
        val promise2 = promise.mapResult(result -> result.whenExceptionApply(e -> e.getClass().getName()));
        assertStrings("Result:{ Value: java.io.IOException }", promise2.getResult());
        
        val ref = new AtomicReference<String>();
        promise.mapResult(result -> result.ifException(e -> ref.set(e.getClass().getName())));
        assertStrings("java.io.IOException", ref.get());
    }