DefaultListModel listModel = new DefaultListModel(new Object[]{"alpha", "bravo", "charlie"});
assertEquals(3, listModel.size());
assertEquals("alpha", listModel.get(0));
assertEquals("bravo", listModel.get(1));
assertEquals("charlie", listModel.get(2));
assertEquals(1, listModel.indexOf("bravo"));
}
public void testListenerManagement() {
ListenerTestDefaultListModel listModel = new ListenerTestDefaultListModel();
TestListDataListener testListener = new TestListDataListener();