protected function granularity()
    {
        $granularity = $this->config('diff.granularity', $this->activity->model_type);

        switch ($granularity) {
            case 'character':
                return new \cogpowered\FineDiff\Granularity\Character;
            case 'word':
                return new \cogpowered\FineDiff\Granularity\Word;
            case 'sentence':
                return new \cogpowered\FineDiff\Granularity\Sentence;
            case 'paragraph':
                return new \cogpowered\FineDiff\Granularity\Paragraph;
        }

        throw new InvalidArgumentException("The '$granularity' granularity is not valid.");
    }