class 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." );
    }

    public  WorkbenchPreferenceScopeResolver( @MapsTo("order") final List<PreferenceScope> order );

}