Code example for Callable

Methods: call

0
    } 
 
    @Override 
    public <T> Future<T> submit(Callable<T> arg0) {
        try { 
            return new MockFuture<T>(arg0.call());
        } catch (Exception e) {
            return new MockFuture<T>(new ExecutionException(e));
        } 
    } 
 
    @Override 
    public Future<?> submit(Runnable arg0) {
        try { 
            arg0.run();
            return new MockFuture<Object>(null);
        } catch (Exception e) {
            return new MockFuture<Object>(new ExecutionException(e));
        } 
    }