public function getBehavior($name)
    {
        /** @var \Cake\ORM\Behavior $behavior */
        $behavior = $this->_behaviors->get($name);
        if ($behavior === null) {
            throw new InvalidArgumentException(sprintf(
                'The %s behavior is not defined on %s.',
                $name,
                get_class($this)
            ));
        }

        return $behavior;
    }