def merge_reference_trees(roots)
      roots.inject(empty_forest) do |forest, root|
        root.keys do |full_key, node|
          if full_key == node.value.to_s
            log_warn(
              "Self-referencing key #{node.full_key(root: false).inspect} in #{node.data[:locale].inspect}"
            )
          end
        end
        forest.merge!(
          root.children,
          on_leaves_merge: lambda do |node, other|
            if node.value != other.value
              log_warn(
                'Conflicting references: '\
            "#{node.full_key(root: false)} ⮕ #{node.value} in #{node.data[:locale]},"\
            " but ⮕ #{other.value} in #{other.data[:locale]}"
              )
            end
          end
        )
      end
    end
def merge_reference_trees(roots)
      roots.inject(empty_forest) do |forest, root|
        root.keys do |full_key, node|
          if full_key == node.value.to_s
            log_warn(
              "Self-referencing key #{node.full_key(root: false).inspect} in #{node.data[:locale].inspect}"
            )
          end
        end
        forest.merge!(
          root.children,
          on_leaves_merge: lambda do |node, other|
            if node.value != other.value
              log_warn(
                'Conflicting references: '\
            "#{node.full_key(root: false)} ⮕ #{node.value} in #{node.data[:locale]},"\
            " but ⮕ #{other.value} in #{other.data[:locale]}"
              )
            end
          end
        )
      end
    end
Given a forest of references, merge trees into one tree, ensuring there are no conflicting references.
 @param roots [I18n::Tasks::Data::Tree::Siblings]
 @return [I18n::Tasks::Data::Tree::Siblings]