### Question:
PreferencesService { public void setProperties(Map<String, String> propMap) throws NotFoundException, ProfileConflictException, BadRequestException { setConfig(new InstanceId(""), propMap); } @Inject  PreferencesService(MessagingService messagingService,
                            CConfiguration cConf, TransactionRunner transactionRunner); Map<String, String> getProperties(); PreferencesDetail getPreferences(); Map<String, String> getProperties(NamespaceId namespaceId); PreferencesDetail getPreferences(NamespaceId namespaceId); Map<String, String> getProperties(ApplicationId applicationId); PreferencesDetail getPreferences(ApplicationId applicationId); Map<String, String> getProperties(ProgramId programId); PreferencesDetail getPreferences(ProgramId programId); Map<String, String> getResolvedProperties(); PreferencesDetail getResolvedPreferences(); Map<String, String> getResolvedProperties(NamespaceId namespaceId); PreferencesDetail getResolvedPreferences(NamespaceId namespaceId); Map<String, String> getResolvedProperties(ApplicationId appId); PreferencesDetail getResolvedPreferences(ApplicationId appId); Map<String, String> getResolvedProperties(ProgramId programId); PreferencesDetail getResolvedPreferences(ProgramId programId); void setProperties(Map<String, String> propMap); Set<String> addProperties(Map<String, String> properties); void setProperties(NamespaceId namespaceId, Map<String, String> propMap); void setProperties(ApplicationId appId, Map<String, String> propMap); void setProperties(ProgramId programId, Map<String, String> propMap); void deleteProperties(); void deleteProperties(NamespaceId namespaceId); void deleteProperties(ApplicationId appId); void deleteProperties(ProgramId programId);  }### Answer:
@Test public void testAddUserProfileToPreferencesInstanceLevel() throws Exception { PreferencesService prefStore = getInjector().getInstance(PreferencesService.class); try { prefStore.setProperties(Collections.singletonMap(SystemArguments.PROFILE_NAME, "userProfile")); Assert.fail(); } catch (BadRequestException e) { } try { prefStore.setProperties(Collections.singletonMap(SystemArguments.PROFILE_NAME, "USER:userProfile")); Assert.fail(); } catch (BadRequestException e) { } }