public static <T> Callable<T> recover(Callable<T> callable,
        Function<Throwable, T> exceptionHandler) {
        return () -> {
            try {
                return callable.call();
            } catch (Exception exception) {
                return exceptionHandler.apply(exception);
            }
        };
    }
@Test(expected = RuntimeException.class)
    public void shouldRethrowException() throws Exception {
        Callable<String> callable = () -> {
            throw new IOException("BAM!");
        };
        Callable<String> callableWithRecovery = CallableUtils.recover(callable, (ex) -> {
            throw new RuntimeException();
        });

        callableWithRecovery.call();
    }