code: public <V> V detach(final AttachmentKey<V> key) {
          assert key != null;
          return key.cast(contextAttachments.remove(key));
      }
docs: Detaches or removes the value from this context.
  
  @param key the key to the attachment.
  @param <V> the value type of the attachment.
  
  @return the attachment if found otherwise {@code null}.