code: def test_Init(self) -> None:
      config1 = MultiObjectiveOptimizationConfig(
          objective=self.multi_objective,
          outcome_constraints=self.outcome_constraints,
      )
      self.assertEqual(str(config1), MOOC_STR)
      with self.assertRaises(TypeError):
          config1.objective = self.objective  # Wrong objective type
      # updating constraints is fine.
      config1.outcome_constraints = [self.outcome_constraint]
      self.assertEqual(len(config1.metrics), 3)
  
      # objective without outcome_constraints is also supported
      config2 = MultiObjectiveOptimizationConfig(
          objective=self.multi_objective
      )
  
      # setting objective is fine too, if it's compatible with constraints.
      config2.objective = self.multi_objective
  
      # setting constraints on objectives is fine for MultiObjective components.
      config2.outcome_constraints = [self.outcome_constraint]
      self.assertEqual(
          config2.outcome_constraints, [self.outcome_constraint]
      )
  
      # construct constraints with objective_thresholds:
      config3 = MultiObjectiveOptimizationConfig(
          objective=self.multi_objective,
          objective_thresholds=self.objective_thresholds,
      )
      self.assertEqual(
          config3.all_constraints, self.objective_thresholds
      )
  
      # objective_thresholds and outcome constraints together.
      config4 = MultiObjectiveOptimizationConfig(
          objective=self.multi_objective,
          objective_thresholds=self.objective_thresholds,
          outcome_constraints=[self.m3_constraint],
      )
      self.assertEqual(
          config4.all_constraints,
          [self.m3_constraint] + self.objective_thresholds,
      )
      self.assertEqual(
          config4.outcome_constraints, [self.m3_constraint]
      )
      self.assertEqual(
          config4.objective_thresholds, self.objective_thresholds
      )
  
      # verify relative_objective_thresholds works:
      config5 = MultiObjectiveOptimizationConfig(
          objective=self.multi_objective,
          objective_thresholds=self.relative_objective_thresholds,
      )
      threshold = config5.objective_thresholds[0]
      self.assertTrue(threshold.relative)
      self.assertEqual(threshold.bound, -1.0)
  
      # ValueError on wrong direction constraints
      with self.assertRaises(UserInputError):
          MultiObjectiveOptimizationConfig(
              objective=self.multi_objective,
              # pyre-fixme[6]: For 2nd param expected
              #  `Optional[List[ObjectiveThreshold]]` but got
              #  `List[OutcomeConstraint]`.
              objective_thresholds=[self.additional_outcome_constraint],
          )
  
      # Test with risk measures.
      self.assertIsNone(config5.risk_measure)
      config6 = MultiObjectiveOptimizationConfig(
          objective=self.multi_objective,
          outcome_constraints=self.outcome_constraints,
          risk_measure=self.multi_output_risk_measure,
      )
      self.assertIs(
          config6.risk_measure, self.multi_output_risk_measure
      )
      expected_str = (
          MOOC_STR[:-1] + ", risk_measure=RiskMeasure(risk_measure="
          "MultiOutputExpectation, options={'n_w': 2}))"
      )
      self.assertEqual(str(config6), expected_str)
      # With scalarized objective.
      config7 = MultiObjectiveOptimizationConfig(
          objective=self.scalarized_objective,
          risk_measure=self.single_output_risk_measure,
      )
      self.assertIs(
          config7.risk_measure, self.single_output_risk_measure
      )
  
imports: from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective, ScalarizedObjective
  from ax.core.optimization_config import _NO_RISK_MEASURE, MultiObjectiveOptimizationConfig, OptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold, OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.risk_measures import RiskMeasure
  from ax.core.types import ComparisonOp
  from ax.exceptions.core import UserInputError
  from ax.utils.common.testutils import TestCase
label_desc: Use image node_id 2 for calling the MultiObjectiveOptimizationConfigTest obj's underlying member method code with example usage: obj.test_Init() without return types