You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: reshare.rb
    path of file: ./repos/diaspora_federation/lib/diaspora_federation/entities
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module DiasporaFederation
  module Entities
  
    
      def validate_root
        return if root_author.nil? && root_guid.nil?

        raise Entity::ValidationError, "#{self}: root_guid can't be nil if root_author is present" if root_guid.nil?
        raise Entity::ValidationError, "#{self}: root_author can't be nil if root_guid is present" if root_author.nil?

        root = RelatedEntity.fetch(root_author, "Post", root_guid)

        return if root_author == root.author

        raise Entity::ValidationError,
              "root_author mismatch: obj=#{self} root_author=#{root_author} known_root_author=#{root.author}"
      end