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
detachedWindowB.getChildren().add(partStack);
		detachedWindowB.setSelectedElement(partStack);
		MPlaceholder placeholderB = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderB.setRef(part);
		partStack.getChildren().add(placeholderB);
		partStack.setSelectedElement(placeholderB);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(part);
		partService.switchPerspective(perspectiveB);
		assertEquals(part, partService.getActivePart());
	}
	private MApplication createApplication(String partId) {
		return createApplication(new String[] { partId });
	}
	private MApplication createApplication(String... partIds) {
		return createApplication(new String[][] { partIds });
	}
	private MApplication createApplication(String[]... partIds) {
		return createApplication(partIds.length, partIds);
	}
	private MApplication createApplication(int windows, String[][] partIds) {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		for (int i = 0; i < windows; i++) {
			MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
			application.getChildren().add(window);
			MPartStack partStack = BasicFactoryImpl.eINSTANCE.createPartStack();