class CompletionHandlerCallback<R, A> implements Runnable {

    private final ListenableFuture<R> future;
    private final CompletionHandler<R, ? super A> completionHandler;
    private final @Nullable A attachment;

    private CompletionHandlerCallback(
        ListenableFuture<R> future,
        CompletionHandler<R, ? super A> completionHandler,
        @Nullable A attachment) {
      this.future = checkNotNull(future);
      this.completionHandler = checkNotNull(completionHandler);
      this.attachment = attachment;
    }

    @Override
    public void run() {<FILL_FUNCTION_BODY>}

    private void onSuccess(R result) {
      completionHandler.completed(result, attachment);
    }

    private void onFailure(Throwable t) {
      completionHandler.failed(t, attachment);
    }
  }

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

      onSuccess(result);
    
<methods>public abstract void force(boolean) throws java.io.IOException,public final Future<java.nio.channels.FileLock> lock() ,public final void lock(A, CompletionHandler<java.nio.channels.FileLock,? super A>) ,public abstract Future<java.nio.channels.FileLock> lock(long, long, boolean) ,public abstract void lock(long, long, boolean, A, CompletionHandler<java.nio.channels.FileLock,? super A>) ,public static transient java.nio.channels.AsynchronousFileChannel open(java.nio.file.Path, java.nio.file.OpenOption[]) throws java.io.IOException,public static transient java.nio.channels.AsynchronousFileChannel open(java.nio.file.Path, Set<? extends java.nio.file.OpenOption>, java.util.concurrent.ExecutorService, FileAttribute<?>[]) throws java.io.IOException,public abstract Future<java.lang.Integer> read(java.nio.ByteBuffer, long) ,public abstract void read(java.nio.ByteBuffer, long, A, CompletionHandler<java.lang.Integer,? super A>) ,public abstract long size() throws java.io.IOException,public abstract java.nio.channels.AsynchronousFileChannel truncate(long) throws java.io.IOException,public final java.nio.channels.FileLock tryLock() throws java.io.IOException,public abstract java.nio.channels.FileLock tryLock(long, long, boolean) throws java.io.IOException,public abstract Future<java.lang.Integer> write(java.nio.ByteBuffer, long) ,public abstract void write(java.nio.ByteBuffer, long, A, CompletionHandler<java.lang.Integer,? super A>) <variables>private static final FileAttribute<?>[] NO_ATTRIBUTES