Bug 166600 [DataBinding] Refactor tests to be in the correct packages
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/tests/internal/databinding/provisional/viewers/SelectionObservableValueTest.java
public void testSetValue() throws Exception {
        Shell shell = new Shell();
        ListViewer viewer = new ListViewer(shell);
        String[] items = new String[] {"1", "2", "3"};
        viewer.setContentProvider(new ArrayContentProvider());
        viewer.setInput(items);
        
        IObservableValue observable = ViewersObservables.observeSingleSelection(viewer);
        ValueChangeEventTracker listener = new ValueChangeEventTracker();
        observable.addValueChangeListener(listener);
        
        assertNull(observable.getValue());
        assertEquals(StructuredSelection.EMPTY, viewer.getSelection());
        assertEquals(0, listener.count);
        
        observable.setValue(items[0]);
        assertEquals("observable value", items[0], observable.getValue());
        assertEquals("viewer selection", items[0], ((StructuredSelection) viewer.getSelection()).getFirstElement());
        assertEquals("value change event", 1, listener.count);
        
        observable.setValue(items[0]);
        assertEquals("value did not change, event should not have fired", 1, listener.count);
        
        observable.setValue(null);
        assertNull(observable.getValue());
        assertEquals("viewer selection should be empty", StructuredSelection.EMPTY, viewer.getSelection());
        assertEquals("value change event did not fire", 2, listener.count);
    }
}