code: public Context attach() {
      Context prev = storage().doAttach(this);
      if (prev == null) {
        return ROOT;
      }
      return prev;
    }
docs: Attach this context, thus enter a new scope within which this context is {@link #current}.  The
  previously current context is returned. It is allowed to attach contexts where {@link
  #isCancelled()} is {@code true}.
  
  <p>Instead of using {@code attach()} and {@link #detach(Context)} most use-cases are better
  served by using the {@link #run(Runnable)} or {@link #call(java.util.concurrent.Callable)} to
  execute work immediately within a context's scope. If work needs to be done in other threads it
  is recommended to use the 'wrap' methods or to use a propagating executor.
  
  <p>All calls to {@code attach()} should have a corresponding {@link #detach(Context)} within
  the same method:
  <pre>{@code Context previous = someContext.attach();
  try {
  // Do work
  } finally {
  someContext.detach(previous);
  }}</pre>