### Question:
PreferenceManager { @Transactional(propagation = Propagation.REQUIRED) public List<Preference> update(List<Preference> preferences) { Assert.isTrue(preferences.stream().allMatch(p -> StringUtils.isNotBlank(p.getName())), messageHelper.getMessage(MessageConstants.ERROR_PREFERENCE_NAME_NOT_SPECIFIED)); systemPreferences.validate(preferences); preferences.forEach(p -> { preferenceDao.upsertPreference(mergeWithDefaults(p)); notifyPreferenceChanged(p); }); return preferences; }  @Transactional(propagation = Propagation.REQUIRED) List<Preference> update(List<Preference> preferences); Optional<Preference> load(String name); Collection<Preference> loadAll(); Collection<Preference> loadVisible(); @Transactional(propagation = Propagation.REQUIRED) void delete(String name); Integer getIntPreference(String name); Float getFloatPreference(String name); Boolean getBooleanPreference(String name); String getStringPreference(String name); Map<String, Object> getObjectPreference(String name); E getPreference(T systemPreference); Observable<E> getObservablePreference(T preference); Preference getSystemPreference(AbstractSystemPreference systemPreference); T getObjectPreferenceAs(final ObjectPreference preference,
                                       final TypeReference<T> typeReference); T getObjectPreferenceAs(final ObjectPreference preference,
                                       final TypeReference<T> typeReference,
                                       final ObjectMapper objectMapper);  }### Answer:
@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Throwable.class) public void updateTest() { Preference preference = new Preference( NAME, VALUE, GROUP, "", PreferenceType.STRING, true); preferenceManager.update(Collections.singletonList(preference)); String load = preferenceManager.getStringPreference(NAME); Assert.assertEquals(VALUE, load); preference.setValue(NEW_VALUE); preferenceManager.update(Collections.singletonList(preference)); load = preferenceManager.getStringPreference(NAME); Assert.assertEquals(NEW_VALUE, load); }