### Question:
AvailableDataTypesBinder extends BaseComboBoxBinder { @Override public void update(Observable o, Object arg) { if (ColumnDefinitionModel.AVAILABLE_DATA_TYPES_PROPERTY.equals(arg)) { String selectedItem = null; if (myModel.getSelectedDefinition() != null) { selectedItem = myModel.getSelectedDefinition().getDataType(); } super.updateComboBox(myModel.getAvailableDataTypes(), selectedItem); } } AvailableDataTypesBinder(JComboBox<String> comboBox, ColumnDefinitionModel model); @Override void update(Observable o, Object arg);  }### Answer:
@SuppressWarnings("unused") @Test public void testUpdate() { ColumnDefinitionModel model = new ColumnDefinitionModel(); JComboBox<String> comboBox = new JComboBox<>(); List<String> availableDataTypes = New.list("dataType1", "dataType2", "dataType3"); AvailableDataTypesBinder binder = new AvailableDataTypesBinder(comboBox, model); model.setAvailableDataTypes(availableDataTypes); assertEquals(availableDataTypes.size(), comboBox.getItemCount()); int index = 0; for (String format : availableDataTypes) { assertEquals(format, comboBox.getItemAt(index).toString()); index++; } model.setAvailableDataTypes(New.<String>list()); assertEquals(0, comboBox.getItemCount()); }