code: public Runnable wrap(final Runnable r) {
      return new Runnable() {
        @Override
        public void run() {
          Context previous = attach();
          try {
            r.run();
          } finally {
            detach(previous);
          }
        }
      };
    }
docs: Wrap a {@link Runnable} so that it executes with this context as the {@link #current} context.