Bug 160000 [DataBinding] Convert scenarios to official APIs
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/databinding/scenarios/ComboViewerScenario.java
for (int i = 0; i < catalog.getLodgings().length; i++) {
            lodgingStrings[i] = catalog.getLodgings()[i].getName();
        }
        assertArrayEquals(lodgingStrings, combo.getItems());
        
        assertEquals(null, ((IStructuredSelection) comboViewer.getSelection()).getFirstElement());
        
        
        final Adventure adventure = SampleData.WINTER_HOLIDAY;
        IObservableValue selection = ViewersObservables.observeSingleSelection(comboViewer);
        getDbc().bindValue(selection, BeansObservables.observeValue(adventure, "defaultLodging"), null);
        
        assertEquals(((IStructuredSelection) comboViewer.getSelection()).getFirstElement(),
                adventure.getDefaultLodging());
        
        adventure.setDefaultLodging(SampleData.CAMP_GROUND);
        assertEquals(adventure.getDefaultLodging(), SampleData.CAMP_GROUND);
        assertEquals(((IStructuredSelection) comboViewer.getSelection()).getFirstElement(),
                adventure.getDefaultLodging());
        
        comboViewer.getCombo().select(3);
        assertEquals(((IStructuredSelection) comboViewer.getSelection()).getFirstElement(),
                adventure.getDefaultLodging());
        adventure.setDefaultLodging(SampleData.YOUTH_HOSTEL);
        spinEventLoop(0);
        assertEquals(((IStructuredSelection) comboViewer.getSelection()).getFirstElement(),
                adventure.getDefaultLodging());
    }
}