Bug 329482 Uninstantiated part may be rendered when closing another part in the same stack
1. Activate the 'Javadoc' view. 2. Activate the 'Package Explorer' view. 3. Shutdown. 4. Restart. 5. Ctrl+3 > Properties 6. Hide the 'Properties' view. 7. Now the 'Problems' view is the selected element. It should be the 'Javadoc' view.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
partB1.setElementId("partB1");
		partB2.setElementId("partB2");
		partStackB.getChildren().add(partB1);
		partStackB.getChildren().add(partB2);
		partStackA.setSelectedElement(partA1);
		partStackB.setSelectedElement(partB1);
		window.setSelectedElement(partStackA);
		application.setSelectedElement(window);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		partService.activate(partA1);
		assertEquals(partA1, partService.getActivePart());
		assertEquals(null, partA2.getContext());
		assertEquals(null, partB2.getContext());
		MPart shownPart = partService.showPart("partA2",
				EPartService.PartState.CREATE);
		assertTrue(partService.isPartVisible(partA1));
		assertTrue(partService.isPartVisible(partB1));
		assertEquals(partA1, partService.getActivePart());
		assertEquals(shownPart, partA2);
		assertNotNull(
				"The part should have been created so it should have a context",
				partA2.getContext());
		assertEquals(
				"This part has not been instantiated yet, it should have no context",
				null, partB2.getContext());
		shownPart = partService.showPart("partB2",
				EPartService.PartState.CREATE);