Bug 326087 StackRenderer arbitrarily changes selected element when MPartStack is being unrendered
1. Open two files. 2. Activate the editor in the back. 3. Restart 4. The file in the wrong is active now. :O
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java
window.setSelectedElement(partStack);
		
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		partStack.getChildren().add(partA);
		partStack.setSelectedElement(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		partStack.getChildren().add(partB);
		appContext.set(MApplication.class.getName(), application);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		assertNotNull(partA.getObject());
		assertNull(partB.getObject());
		
		appContext.get(EPartService.class).hidePart(partA, true);
		assertNull(partA.getObject());
		assertNotNull(partB.getObject());
	}
	public void testBug317591_NonSharedPart() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		final MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
		window.getChildren().add(stack);
		window.setSelectedElement(stack);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");