code: def test_register_existing_trial(self):
      lineages = Lineages()
      trial = TrialStub(id="my-id")
      lineage = lineages.add(trial)
      assert lineages._lineage_roots == [lineage]
      assert lineage.item.objective is None
  
      trial.objective = ObjectiveStub(1)
      assert lineages.register(trial) is lineage
      assert lineages._lineage_roots == [lineage]
      assert lineage.item.objective.value == 1
  
imports: import os
  import random
  import pytest
  from base import ObjectiveStub, TrialStub, build_full_tree, build_population, compare_generations
  from orion.algo.pbt.pbt import LineageNode, Lineages
label_desc: Use image node_id 12 for calling the TestLineages obj's underlying member method code with example usage: obj.test_register_existing_trial() without return types