@Override
    public void run() {
      R result;
      try {
        result = Futures.getDone(future);
      } catch (ExecutionException e) {
        onFailure(e.getCause());
        return;
      } catch (RuntimeException | Error e) {
        onFailure(e);
        return;
      }

      onSuccess(result);
    }
Runnable callback that wraps a {@link CompletionHandler} and an attachment.
jimfs/src/main/java/com/google/common/jimfs/JimfsAsynchronousFileChannel.java