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
window.getChildren().add(perspectiveStack);
		window.setSelectedElement(perspectiveStack);
		MPerspective perspective = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspective);
		perspectiveStack.setSelectedElement(perspective);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		perspective.getChildren().add(partA);
		perspective.setSelectedElement(partA);
		MWindow detachedWindow = BasicFactoryImpl.eINSTANCE.createWindow();
		perspective.getWindows().add(detachedWindow);
		MPartStack partStack = BasicFactoryImpl.eINSTANCE.createPartStack();
		detachedWindow.getChildren().add(partStack);
		detachedWindow.setSelectedElement(partStack);
		MPlaceholder placeholderB = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderB.setRef(partB);
		partB.setCurSharedRef(placeholderB);
		partStack.getChildren().add(placeholderB);
		partStack.setSelectedElement(placeholderB);
		MPart partC = BasicFactoryImpl.eINSTANCE.createPart();
		partStack.getChildren().add(partC);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(partA);
		partService.activate(partB);
		partService.activate(partC);
		partService.hidePart(partC);
		assertEquals(partB, partService.getActivePart());