### Question:
WorkbenchPreferenceScopeResolutionStrategy implements PreferenceScopeResolutionStrategy { @Override public PreferenceScopeResolutionStrategyInfo getInfo() { return info; } WorkbenchPreferenceScopeResolutionStrategy(); @Inject  WorkbenchPreferenceScopeResolutionStrategy( final PreferenceScopeFactory scopeFactory );  WorkbenchPreferenceScopeResolutionStrategy( final PreferenceScopeFactory scopeFactory,
                                                       final PreferenceScope... scopes ); @Override PreferenceScopeResolutionStrategyInfo getInfo(); @Override PreferenceScopeResolver getScopeResolver(); PreferenceScope getDefaultScope( final List<PreferenceScope> order );  }### Answer:
@Test public void defaultScopeInfoTest() { final List<PreferenceScope> order = defaultPreferenceScopeResolutionStrategy.getInfo().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 = defaultPreferenceScopeResolutionStrategy.getInfo().defaultScope(); assertEquals( "user", defaultScope.type() ); assertEquals( "admin", defaultScope.key() ); }
@Test public void orderWithProjectScopeTest() { PreferenceScope userScope = scopesFactory.createScope( WorkbenchPreferenceScopes.USER ); PreferenceScope projectScope = scopesFactory.createScope( WorkbenchPreferenceScopes.PROJECT, "my-project" ); PreferenceScope userProjectScope = scopesFactory.createScope( userScope, projectScope ); defaultPreferenceScopeResolutionStrategy = new WorkbenchPreferenceScopeResolutionStrategy( scopesFactory, userProjectScope ); final List<PreferenceScope> order = defaultPreferenceScopeResolutionStrategy.getInfo().order(); assertEquals( 3, order.size() ); final PreferenceScope firstScope = order.get( 0 ); assertEquals( "user", firstScope.type() ); assertEquals( "admin", firstScope.key() ); assertEquals( "project", firstScope.childScope().type() ); assertEquals( "my-project", firstScope.childScope().key() ); final PreferenceScope secondScope = order.get( 1 ); assertEquals( "user", secondScope.type() ); assertEquals( "admin", secondScope.key() ); final PreferenceScope threeScope = order.get( 2 ); assertEquals( "global", threeScope.type() ); assertEquals( "global", threeScope.key() ); final PreferenceScope defaultScope = defaultPreferenceScopeResolutionStrategy.getInfo().defaultScope(); assertEquals( "user", defaultScope.type() ); assertEquals( "admin", defaultScope.key() ); assertEquals( "project", defaultScope.childScope().type() ); assertEquals( "my-project", defaultScope.childScope().key() ); }