### Question:
WorkbenchPreferenceScopeTypes implements PreferenceScopeTypes { @Override public boolean typeRequiresKey(final String type) throws InvalidPreferenceScopeException { validateType(type); return defaultKeyByType.get(type) == null; } protected  WorkbenchPreferenceScopeTypes(); @Inject  WorkbenchPreferenceScopeTypes(final UsernameProvider usernameProvider); @Override boolean typeRequiresKey(final String type); @Override String getDefaultKeyFor(final String type);  }### Answer:
@Test public void typesRequireKeyTest() { assertFalse(scopeTypes.typeRequiresKey(WorkbenchPreferenceScopes.GLOBAL)); assertFalse(scopeTypes.typeRequiresKey(WorkbenchPreferenceScopes.USER)); assertTrue(scopeTypes.typeRequiresKey(WorkbenchPreferenceScopes.PROJECT)); assertTrue(scopeTypes.typeRequiresKey(WorkbenchPreferenceScopes.SPACE)); }