Bug 127861 [DataBinding] Mark API provisional
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/jface/databinding/SelectionAwareUpdatableCollectionTest.java
collection.setElements(elementsToUpdate);
		
		assertEquals("The collection was not updated to the right size.", 3, collection.getSize());
		assertEquals("The wrong element was found in position 0", string3, collection.getElement(0));
		assertEquals("The wrong element was found in position 1", string4, collection.getElement(1));
		assertEquals("The wrong element was found in position 2", string5, collection.getElement(2));
		assertNull("The selected object was not reset as expected", collection.getSelectedObject());
		
		assertNotSame("The all elements list instance should not be the one provided in the set.", elementsToUpdate, collection.getElements());
		
		List returnedList = collection.getElements();
		assertEquals("The wrong element was found in position 0 of the returned list", string3, returnedList.get(0));
		assertEquals("The wrong element was found in position 1 of the returned list", string4, returnedList.get(1));
		assertEquals("The wrong element was found in position 2 of the returned list", string5, returnedList.get(2));
		
		collection.setSelectedObject(string3);
		
		elementsToUpdate = new ArrayList();
		elementsToUpdate.add(string1);
		elementsToUpdate.add(string2);
		elementsToUpdate.add(string3);
		
		collection.setElements(elementsToUpdate);
		
		assertSame("The selected element was not retained.", string3, collection.getSelectedObject());
	}
	private class TestSelectionUpdatableCollection extends SelectionAwareUpdatableCollection {
		private List elements = new ArrayList();
		private Object selected;