public function set($key, $value = null, $group = null)
    {
        if ($key instanceof Attribute) {
            return $this->setInstance($key);
        }

        if ($this->has($key)) {
            $this->update($key, $value, $group);
        } else {
            $this->items[$key] = $this->newAttribute($key, $value, $group);
        }

        return $this;
    }