Bug 311721 Cleanup context strategy
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessStartupTest.java
appContext.set(IEclipseContext.class.getName(), appContext);
		appContext.set(IContributionFactory.class.getName(),
				new ReflectionContributionFactory(
						(IExtensionRegistry) appContext
								.get(IExtensionRegistry.class.getName())));
		appContext.set(IExceptionHandler.class.getName(),
				new ExceptionHandler());
		
		appContext.set(Logger.class.getName(), new WorkbenchLogger());
		appContext.set(Adapter.class.getName(), ContextInjectionFactory.make(
				EclipseAdapter.class, appContext));
		appContext.set(ContextManager.class.getName(), new ContextManager());
		appContext.set(IServiceConstants.ACTIVE_CONTEXTS,
				new ActiveContextsFunction());
		appContext.set(IServiceConstants.ACTIVE_PART,
				new ActivePartLookupFunction());
		appContext.runAndTrack(new IRunAndTrack() {
			public boolean notify(ContextChangeEvent event) {
				IEclipseContext eventsContext = event.getContext();
				Object o = eventsContext.get(IServiceConstants.ACTIVE_PART);
				if (o instanceof MPart) {
					eventsContext.set(IServiceConstants.ACTIVE_PART_ID,
							((MPart) o).getElementId());
				}
				return true;
			}
			@Override
			public String toString() {
				return "HeadlessStartupTest$RunAndTrack[" 
						+ IServiceConstants.ACTIVE_PART_ID + ']';