protected function assertInstance($entity)
    {
        $entityClass = $this->definition->entity();
        if (!$entity instanceof $entityClass) {
            throw new RelationException(sprintf('Relation entity must be instance of %s, got %s', $entityClass, $this->getType($entity)));
        }

        return true;
    }