docs: private static <TContinuationResult, TResult> void completeAfterTask(
        final bolts.TaskCompletionSource<TContinuationResult> tcs,
        final Continuation<TResult, Task<TContinuationResult>> continuation,
        final Task<TResult> task, final Executor executor,
        final CancellationToken ct) {
      try {
        executor.execute(new Runnable() {
          @Override
          public void run() {
            if (ct != null && ct.isCancellationRequested()) {
              tcs.setCancelled();
              return;
            }
  
            try {
              Task<TContinuationResult> result = continuation.then(task);
              if (result == null) {
                tcs.setResult(null);
              } else {
                result.continueWith(new Continuation<TContinuationResult, Void>() {
                  @Override
                  public Void then(Task<TContinuationResult> task) {
                    if (ct != null && ct.isCancellationRequested()) {
                      tcs.setCancelled();
                      return null;
                    }
  
                    if (task.isCancelled()) {
                      tcs.setCancelled();
                    } else if (task.isFaulted()) {
                      tcs.setError(task.getError());
                    } else {
                      tcs.setResult(task.getResult());
                    }
                    return null;
                  }
                });
              }
            } catch (CancellationException e) {
              tcs.setCancelled();
            } catch (Exception e) {
              tcs.setError(e);
            }
          }
        });
      } catch (Exception e) {
        tcs.setError(new ExecutorException(e));
      }
    }