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

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

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