@Test
public void applyEditorTo() {

  // Arrange
  AndroidDebuggerContext androidDebuggerContext = Mockito.mock(AndroidDebuggerContext.class);
  DeployTargetProvider provider = new CloudTestMatrixTargetProvider();
  List<DeployTargetProvider> providers = Arrays.asList(new DeviceAndSnapshotComboBoxTargetProvider(), provider);
  AndroidTestRunConfiguration configuration1 = Mockito.mock(AndroidTestRunConfiguration.class);
  Mockito.when(configuration1.getAndroidDebuggerContext()).thenReturn(androidDebuggerContext);
  Mockito.when(configuration1.getApplicableDeployTargetProviders()).thenReturn(providers);
  Mockito.when(configuration1.getProfilerState()).thenReturn(new ProfilerState());
  @SuppressWarnings("unchecked")
  ConfigurationSpecificEditor<AndroidTestRunConfiguration> configurationSpecificEditor = Mockito.mock(ConfigurationSpecificEditor.class);
  Mockito.when(configurationSpecificEditor.getComponent()).thenReturn(new JLabel());
  AndroidRunConfigurationEditor<AndroidTestRunConfiguration> androidRunConfigurationEditor =
    new AndroidRunConfigurationEditor<>(
      myRule.getProject(),
      facet -> false,
      configuration1,
      true,
      moduleSelector -> configurationSpecificEditor);
  DeployTargetContext deployTargetContext = new DeployTargetContext(providers);
  AndroidTestRunConfiguration configuration2 = Mockito.mock(AndroidTestRunConfiguration.class);
  Mockito.when(configuration2.getDeployTargetContext()).thenReturn(deployTargetContext);
  Mockito.when(configuration2.getProfilerState()).thenReturn(new ProfilerState());
  // Act
  androidRunConfigurationEditor.getDeploymentTargetOptions().getTargetComboBox().setSelectedItem(provider);
  androidRunConfigurationEditor.applyEditorTo(configuration2);
  // Assert
  assertEquals(TargetSelectionMode.FIREBASE_DEVICE_MATRIX, deployTargetContext.getTargetSelectionMode());
}