### Question:
WorkbenchPreferenceScopeResolutionStrategiesImpl implements WorkbenchPreferenceScopeResolutionStrategies { @Override public PreferenceScopeResolutionStrategyInfo getSpaceInfoFor(final String scopeKey) { PreferenceScopeResolutionStrategy scopeResolutionStrategy; if (scopeKey != null) { final PreferenceScope spaceScope = scopeFactory.createScope(WorkbenchPreferenceScopes.SPACE, scopeKey); scopeResolutionStrategy = new WorkbenchPreferenceScopeResolutionStrategy(scopeFactory, spaceScope); } else { scopeResolutionStrategy = new WorkbenchPreferenceScopeResolutionStrategy(scopeFactory); } return scopeResolutionStrategy.getInfo(); } WorkbenchPreferenceScopeResolutionStrategiesImpl(); @Inject  WorkbenchPreferenceScopeResolutionStrategiesImpl( final PreferenceScopeFactory scopeFactory ); @Override PreferenceScopeResolutionStrategyInfo getUserInfoFor(final String scopeType,
                                                                final String scopeKey ); @Override PreferenceScopeResolutionStrategyInfo getSpaceInfoFor(final String scopeKey);  }### Answer:
@Test public void getSpaceInfoTest() { final PreferenceScopeResolutionStrategyInfo scopeInfo = scopeResolutionStrategies.getSpaceInfoFor(null); final List<PreferenceScope> order = scopeInfo.order(); assertEquals(2, order.size()); final PreferenceScope firstScope = order.get(0); assertEquals("user", firstScope.type()); assertEquals("admin", firstScope.key()); final PreferenceScope secondScope = order.get(1); assertEquals("global", secondScope.type()); assertEquals("global", secondScope.key()); final PreferenceScope defaultScope = scopeInfo.defaultScope(); assertEquals("user", defaultScope.type()); assertEquals("admin", defaultScope.key()); }
@Test public void getSpaceInfoWithScopeTest() { final PreferenceScopeResolutionStrategyInfo scopeInfo = scopeResolutionStrategies.getSpaceInfoFor("mySpace"); final List<PreferenceScope> order = scopeInfo.order(); assertEquals(3, order.size()); final PreferenceScope firstScope = order.get(0); assertEquals("space", firstScope.type()); assertEquals("mySpace", firstScope.key()); final PreferenceScope secondScope = order.get(1); assertEquals("user", secondScope.type()); assertEquals("admin", secondScope.key()); final PreferenceScope thirdScope = order.get(2); assertEquals("global", thirdScope.type()); assertEquals("global", thirdScope.key()); final PreferenceScope defaultScope = scopeInfo.defaultScope(); assertEquals("space", defaultScope.type()); assertEquals("mySpace", defaultScope.key()); }