/** {@inheritDoc} */
  @Override
  public void setAttribute(Object key, @Nullable Object val) {
    A.notNull(key, "key");

    synchronized (attrs) {
      attrs.put(key, val);
    }
  }
  /** {@inheritDoc} */
  @Override
  public void setAttributes(Map<?, ?> attrs) {
    A.notNull(attrs, "attrs");

    synchronized (this.attrs) {
      this.attrs.putAll(attrs);
    }
  }
  /** {@inheritDoc} */
  @SuppressWarnings("unchecked")
  @Override
  public <K, V> V getAttribute(K key) {
    A.notNull(key, "key");

    synchronized (attrs) {
      return (V) attrs.get(key);
    }
  }