code: def test_add_trial_same_arm(self) -> None:
      # Check that adding new arm w/out name works correctly.
      new_trial1 = self.experiment.new_trial(
          generator_run=GeneratorRun(
              arms=[self.arm.clone(clear_name=True)]
          )
      )
      self.assertEqual(new_trial1.arm.name, self.trial.arm.name)
      self.assertFalse(new_trial1.arm is self.trial.arm)
      # Check that adding new arm with name works correctly.
      new_trial2 = self.experiment.new_trial(
          generator_run=GeneratorRun(arms=[self.arm.clone()])
      )
      self.assertEqual(new_trial2.arm.name, self.trial.arm.name)
      self.assertFalse(new_trial2.arm is self.trial.arm)
      arm_wrong_name = self.arm.clone(clear_name=True)
      arm_wrong_name.name = "wrong_name"
      with self.assertRaises(ValueError):
          new_trial2 = self.experiment.new_trial(
              generator_run=GeneratorRun(arms=[arm_wrong_name])
          )
  
imports: import itertools
  from copy import deepcopy
  from unittest import mock
  from unittest.mock import Mock, patch
  import pandas
  from ax.core.base_trial import BaseTrial, TrialStatus
  from ax.core.data import Data
  from ax.core.generator_run import GeneratorRun, GeneratorRunType
  from ax.core.runner import Runner
  from ax.exceptions.core import UserInputError
  from ax.runners.synthetic import SyntheticRunner
  from ax.utils.common.result import Ok
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_arms, get_branin_arms, get_experiment, get_objective, get_test_map_data_experiment
label_desc: Use image node_id 6 for calling the TrialTest obj's underlying member method code with example usage: obj.test_add_trial_same_arm() without return types