Bug 329310 Part service does not autogenerate stacks if the last container is not one
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
perspectiveB.setSelectedElement(partStackB);
		MPlaceholder partPlaceholderA2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partPlaceholderA2.setRef(partA);
		partStackB.getChildren().add(partPlaceholderA2);
		partStackB.setSelectedElement(partPlaceholderA2);
		MPlaceholder partPlaceholderB2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partPlaceholderB2.setRef(partB);
		partStackB.getChildren().add(partPlaceholderB2);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(partB);
		partService.switchPerspective(perspectiveB);
		assertEquals(
				"partB is in both perspectives, but since partB is obscured by partA, partA should be the active part",
				partA, partService.getActivePart());
		partService.hidePart(partB);
		assertEquals("partA should still be the active part", partA,
				partService.getActivePart());
		partService.switchPerspective(perspectiveA);
		assertEquals(
				"partA is in both perspectives, but since partA is obscured by partB, partB should be the active part",
				partB, partService.getActivePart());
		partService.activate(partB);
		assertEquals("partB should have been activated by activate(MPart)",
				partB, partService.getActivePart());
		partService.switchPerspective(perspectiveB);
		assertEquals(