### Question:
ComboBoxSelectionModel extends AbstractValueModel { @Override public Object getValue() { return d_comboBox.getSelectedItem(); } ComboBoxSelectionModel(JComboBox comboBox); @Override Object getValue(); @Override void setValue(Object newValue);  }### Answer:
@Test public void testValueMatchesSelection() { Object[] items = {"item 1", ""}; JComboBox combo = new JComboBox(items); ComboBoxSelectionModel model = new ComboBoxSelectionModel(combo); assertEquals(items[0], model.getValue()); combo.setSelectedIndex(1); assertEquals(items[1], model.getValue()); combo.setSelectedIndex(0); assertEquals(items[0], model.getValue()); combo.setSelectedIndex(-1); assertEquals(null, model.getValue()); }