Bug 319004 CCE caused by PartRenderingEngine assuming a parent eContainer() is an MElementContainer
An MMenu's container could be an MPart, which leads to a CCE in createGui(MUIElement).
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java
appContext.set(MApplication.class.getName(), application);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(part1);
		partService.activate(part2);
		partService.activate(part1);
		partService.switchPerspective(perspectiveB);
		partService.switchPerspective(perspectiveA);
		SampleView view1 = (SampleView) part1.getObject();
		SampleView view2 = (SampleView) part2.getObject();
		appContext.get(IPresentationEngine.class).removeGui(window);
		assertFalse(view1.nullParentContext);
		assertFalse(view2.nullParentContext);
	}
	public void testBug327807() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPartStack partStack = BasicFactoryImpl.eINSTANCE.createPartStack();
		window.getChildren().add(partStack);
		window.setSelectedElement(partStack);
		MPart part1 = BasicFactoryImpl.eINSTANCE.createPart();
		partStack.getChildren().add(part1);
		partStack.setSelectedElement(part1);
		MPart part2 = BasicFactoryImpl.eINSTANCE.createPart();
		partStack.getChildren().add(part2);
		application.setContext(appContext);