code: public <V> V attach(final AttachmentKey<V> key, final V value) {
          assert key != null;
          return key.cast(contextAttachments.put(key, value));
      }
docs: Attaches an arbitrary object to this context.
  
  @param key   they attachment key used to ensure uniqueness and used for retrieval of the value.
  @param value the value to store.
  @param <V>   the value type of the attachment.
  
  @return the previous value associated with the key or {@code null} if there was no previous value.