code: def test_observation_data_to_array(self) -> None:
      outcomes = ["a", "b", "c"]
      obsd = ObservationData(
          metric_names=["c", "a", "b"],
          means=np.array([1, 2, 3]),
          covariance=np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
      )
      Y, Ycov = observation_data_to_array(
          outcomes=outcomes, observation_data=[obsd]
      )
      self.assertTrue(np.array_equal(Y, np.array([[2, 3, 1]])))
      self.assertTrue(
          np.array_equal(
              Ycov, np.array([[[5, 6, 4], [8, 9, 7], [2, 3, 1]]])
          )
      )
  
      # With missing metrics.
      obsd2 = ObservationData(
          metric_names=["c", "a"],
          means=np.array([1, 2]),
          covariance=np.array([[1, 2], [4, 5]]),
      )
      with mock.patch(
          "ax.modelbridge.modelbridge_utils.logger.warning"
      ) as mock_warn:
          Y, Ycov = observation_data_to_array(
              outcomes=outcomes, observation_data=[obsd, obsd2]
          )
      self.assertTrue(np.array_equal(Y, np.array([[2, 3, 1]])))
      self.assertTrue(
          np.array_equal(
              Ycov, np.array([[[5, 6, 4], [8, 9, 7], [2, 3, 1]]])
          )
      )
      mock_warn.assert_called_once()
  
imports: from unittest import mock
  from unittest.mock import patch
  import numpy
  from ax.core.arm import Arm
  from ax.core.data import Data
  from ax.core.generator_run import GeneratorRun
  from ax.core.metric import Metric
  from ax.core.objective import MultiObjective, Objective
  from ax.core.observation import ObservationData, ObservationFeatures
  from ax.core.optimization_config import MultiObjectiveOptimizationConfig
  from ax.core.outcome_constraint import ObjectiveThreshold, OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.types import ComparisonOp
  from ax.core.utils import get_pending_observation_features
  from ax.modelbridge.modelbridge_utils import extract_objective_thresholds, extract_outcome_constraints, feasible_hypervolume, observation_data_to_array, pending_observations_as_array_list
  from ax.modelbridge.registry import Models
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import not_none
  from ax.utils.testing.core_stubs import get_experiment, get_hierarchical_search_space_experiment
  from pyre_extensions import none_throws
label_desc: Use image node_id 4 for calling the TestModelbridgeUtils obj's underlying member method code with example usage: obj.test_observation_data_to_array() without return types