Bug 262392 [DataBinding] CompositeMap constructor should use this.firstMap
Using EclEmma, I noticed that large portions of BidiObservableMap are not run, indicating a problem in CompositeMap. This needs more thought. I am attaching a patch, it includes one test case but we may want to add more tests.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/map/CompositeMapTest.java
assertEquals(new Integer(42), composedMap.get(person1));
	}
	public void testRemoveFromFirstMap() {
		MapChangeEventTracker tracker = new MapChangeEventTracker();
		SimplePerson newPerson = new SimplePerson("p1", "a1", "c1", "s1");
		newPerson.getCart().setNumItems(42);
		persons.add(newPerson);
		assertTrue("newPerson should be added", composedMap.containsKey(newPerson));
		composedMap.addMapChangeListener(tracker);
		assertEquals(0, tracker.count);
		persons.remove(newPerson);
		assertEquals(1, tracker.count);
		assertEquals(0, tracker.event.diff.getAddedKeys().size());
		assertEquals(0, tracker.event.diff.getChangedKeys().size());
		assertEquals(Collections.singleton(newPerson), tracker.event.diff
				.getRemovedKeys());
		assertEquals(new Integer(42), tracker.event.diff.getOldValue(newPerson));
		assertFalse("newPerson should be removed", composedMap.containsKey(newPerson));
	}
	public void testRemoveSharedFromFirstMap() {
		SimplePerson person1 = new SimplePerson("p1", "a1", "c1", "s1");
		person1.getCart().setNumItems(42);
		persons.add(person1);
		SimplePerson person2 = new SimplePerson("p1", "a1", "c1", "s1");
		person2.setCart(person1.getCart());
		persons.add(person2);
		assertTrue("person2 should be added", composedMap.containsKey(person2));
		MapChangeEventTracker tracker = new MapChangeEventTracker();
		composedMap.addMapChangeListener(tracker);
		assertEquals(0, tracker.count);