code: def test_fork_existing_trial(self, tmp_path):
      lineages = Lineages()
      trial = TrialStub(
          id="stub", working_dir=os.path.join(tmp_path, "stub")
      )
      os.makedirs(trial.working_dir)
      lineage = lineages.add(trial)
      assert len(lineages) == 1
      new_trial = TrialStub(
          id="fork", working_dir=os.path.join(tmp_path, "fork")
      )
      new_lineage = lineages.fork(trial, new_trial)
      assert len(lineages) == 1
      assert lineages._lineage_roots[0].children[0] is new_lineage
      assert lineages._trial_to_lineages["fork"] is new_lineage
  
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 3 for calling the TestLineages obj's underlying member method code with example usage: obj.test_fork_existing_trial(tmp_path) without return types