Bug 331062 NPE with EModelService's getElementLocation(MUIElement) on a model within a perspective that's not under the application
java.lang.NullPointerException at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getElementLocation(ModelServiceImpl.java:740)
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EModelServiceTest.java
perspective.getChildren().add(placeholder);
		perspective.setSelectedElement(placeholder);
		MPartSashContainer partSashContainer = BasicFactoryImpl.eINSTANCE
				.createPartSashContainer();
		placeholder.setRef(partSashContainer);
		partSashContainer.setCurSharedRef(placeholder);
		MPartStack partStack = BasicFactoryImpl.eINSTANCE.createPartStack();
		partSashContainer.getChildren().add(partStack);
		partSashContainer.setSelectedElement(partStack);
		getEngine().createGui(window);
		EModelService modelService = window.getContext().get(
				EModelService.class);
		MPerspective foundPerspective = modelService
				.getPerspectiveFor(partStack);
		assertNotNull(foundPerspective);
		assertEquals(perspective, foundPerspective);
	}
	public void testBringToTop01() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		application.setContext(applicationContext);
		MWindow windowA = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.setSelectedElement(windowA);
		MWindow windowB = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowB);
		getEngine().createGui(windowA);
		getEngine().createGui(windowB);
		assertEquals(windowA, application.getSelectedElement());
		EModelService modelService = applicationContext