code: private static <TContinuationResult, TResult> void completeImmediately(
        final bolts.TaskCompletionSource<TContinuationResult> tcs,
        final Continuation<TResult, TContinuationResult> continuation, final Task<TResult> task,
        Executor executor, final CancellationToken ct) {
      try {
        executor.execute(new Runnable() {
          @Override
          public void run() {
            if (ct != null && ct.isCancellationRequested()) {
              tcs.setCancelled();
              return;
            }
  
            try {
              TContinuationResult result = continuation.then(task);
              tcs.setResult(result);
            } catch (CancellationException e) {
              tcs.setCancelled();
            } catch (Exception e) {
              tcs.setError(e);
            }
          }
        });
      } catch (Exception e) {
        tcs.setError(new ExecutorException(e));
      }
    }
docs: Handles the non-async (i.e. the continuation doesn't return a Task) continuation case, passing
  the results of the given Task through to the given continuation and using the results of that
  call to set the result of the TaskContinuationSource.
  
  @param tcs
  The TaskContinuationSource that will be orchestrated by this call.
  @param continuation
  The non-async continuation.
  @param task
  The task being completed.
  @param executor
  The executor to use when running the continuation (allowing the continuation to be
  scheduled on a different thread).