### Question:
WorkbenchPreferenceScopeResolver implements PreferenceScopeResolver { @Override public PreferenceScope resolve( final String... scopeTypes ) { if ( scopeTypes != null && scopeTypes.length == 1 ) { if ( WorkbenchPreferenceScopes.getUserScopedScopes().contains( scopeTypes[0] ) ) { return getScopeFromOrder( WorkbenchPreferenceScopes.USER, scopeTypes[0] ); } return getScopeFromOrder( scopeTypes ); } throw new InvalidPreferenceScopeException( "The passed scope types are invalid." ); } WorkbenchPreferenceScopeResolver( @MapsTo("order") final List<PreferenceScope> order ); @Override PreferenceScope resolve( final String... scopeTypes );  }### Answer:
@Test public void resolveValidScopesTest() { assertEquals( projectScope, scopeResolver.resolve( "project" ) ); assertEquals( userScope, scopeResolver.resolve( "user" ) ); assertEquals( globalScope, scopeResolver.resolve( "global" ) ); }
@Test(expected = InvalidPreferenceScopeException.class) public void tryResolveWithInvalidScopeTypeTest() { scopeResolver.resolve( "invalidScopeType" ); }
@Test(expected = InvalidPreferenceScopeException.class) public void tryResolveWithNoScopeTypesTest() { scopeResolver.resolve(); }
@Test(expected = InvalidPreferenceScopeException.class) public void tryResolveWithTwoScopeTypesTest() { scopeResolver.resolve( "project", "user" ); }