public static function fromEntity($entity, array $overrides = []): self
    {
        if (!is_object($entity)) {
            throw new \InvalidArgumentException('Given entity must be an object.');
        }

        $annotations = annotationsOf($entity);
        if (!$annotations->contain('RssFeedItem')) {
            throw new XmlException(
                    'Class ' . get_class($entity) . ' is not annotated with @RssFeedItem.'
            );
        }

        $rssFeedItemAnnotation = $annotations->firstNamed('RssFeedItem');
        $self = new self(
                $overrides['title'] ??
                self::getRequiredAttribute(
                        $entity,
                        'title',
                        $rssFeedItemAnnotation->getTitleMethod('getTitle')
                ),
                $overrides['link'] ??
                self::getRequiredAttribute(
                        $entity,
                        'link',
                        $rssFeedItemAnnotation->getLinkMethod('getLink')
                ),
                $overrides['description'] ??
                self::getRequiredAttribute(
                        $entity,
                        'description',
                        $rssFeedItemAnnotation->getDescriptionMethod('getDescription')
                )
        );

        foreach (self::METHODS as $itemMethod => $defaultMethod) {
            if (isset($overrides[$itemMethod])) {
                $self->$itemMethod($overrides[$itemMethod]);
                continue;
            }

            if (substr($defaultMethod, 0, 3) === 'get') {
                $annotationMethod = $defaultMethod . 'Method';
            } else {
                $annotationMethod = 'get' . $defaultMethod . 'Method';
            }

            $entityMethod = $rssFeedItemAnnotation->$annotationMethod($defaultMethod);
            if (method_exists($entity, $entityMethod)) {
                $self->$itemMethod($entity->$entityMethod());
            }
        }

        return $self;
    }