@Test
public void shouldBindCollectionToComboBoxModel() throws Exception
{
// given
ModelForTests model = new ModelForTests();
JComboBox box = new JComboBox();
Binding.bind().valueOf(model, ModelForTests.ITEMS_AS_LIST).toItemsOf(box);
Object[] items = {"a", "b"};
// when
model.setItemsAsList(Arrays.asList(items));
// then
assertEquals(2, box.getModel().getSize());
assertEquals(items[0], box.getModel().getElementAt(0));
assertEquals(items[1], box.getModel().getElementAt(1));
}