### Question:
AvailableFormatsBinder extends BaseComboBoxBinder { @Override public void update(Observable o, Object arg) { if (ColumnDefinitionModel.AVAILABLE_FORMATS_PROPERTY.equals(arg)) { String selectedItem = null; if (myModel.getSelectedDefinition() != null) { selectedItem = myModel.getSelectedDefinition().getFormat(); } super.updateComboBox(myModel.getAvailableFormats(), selectedItem); } else if (ColumnDefinitionModel.CAN_ADD_FORMATS_PROPERTY.equals(arg)) { myComboBox.setEditable(myModel.canAddFormats()); } } AvailableFormatsBinder(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> formats = New.list("format1", "format2", "format3"); AvailableFormatsBinder binder = new AvailableFormatsBinder(comboBox, model); model.setAvailableFormats(formats); assertEquals(formats.size(), comboBox.getItemCount()); int index = 0; for (String format : formats) { assertEquals(format, comboBox.getItemAt(index).toString()); index++; } model.setAvailableFormats(New.<String>list()); assertEquals(0, comboBox.getItemCount()); }