Bug 342998 Refactor ESelectionService into multiple classes
While there is a master/slave relationship "enforced" by the current implementation, it is non-obvious as the code is quite convoluted. The implementation needs to be refactored to enhance readability.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/ESelectionServiceTest.java
partThreeImpl.setSelection(selection2);
		assertEquals(selection, partOneImpl.input);
		assertNull(partOneImpl.otherSelection);
		assertNull(partTwoImpl.input);
		assertEquals(selection2, partThreeImpl.input);
		ESelectionService selectionService = (ESelectionService) partContextA
				.get(ESelectionService.class.getName());
		selectionService.addSelectionListener(partC.getElementId(),
				new ISelectionListener() {
					public void selectionChanged(MPart part, Object selection) {
						partOneImpl.setOtherSelection(selection);
					}
				});
		partThreeImpl.setSelection(selection3);
		assertEquals(selection, partOneImpl.input);
		assertEquals(selection3, partOneImpl.otherSelection);
		assertNull(partTwoImpl.input);
		assertEquals(selection3, partThreeImpl.input);
		partThreeImpl.setSelection(selection);
		assertEquals(selection, partOneImpl.input);
		assertEquals(selection, partOneImpl.otherSelection);
		assertNull(partTwoImpl.input);
		assertEquals(selection, partThreeImpl.input);
		partThreeImpl.setSelection(null);
		assertEquals(selection, partOneImpl.input);
		assertNull(partOneImpl.otherSelection);
		assertNull(partTwoImpl.input);
		assertNull(partThreeImpl.input);
	}
	static class Target {