### Question:
PreferenceManager { public <E, T extends AbstractSystemPreference<E>> Observable<E> getObservablePreference(T preference) { Subject<E> preferenceSubject; if (!subjectMap.contains(preference)) { preferenceSubject = PublishSubject.create(); subjectMap.put(preference, preferenceSubject); } else { preferenceSubject = (Subject<E>) subjectMap.get(preference); } return preferenceSubject; }  @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 testGetObservablePreference() { Observable<Integer> commitTimeoutObservable = preferenceManager.getObservablePreference( SystemPreferences.COMMIT_TIMEOUT); TestSubscriber<Integer> test1 = new TestSubscriber<>(); TestSubscriber<Integer> test2 = new TestSubscriber<>(); commitTimeoutObservable.subscribe(test1::onNext); commitTimeoutObservable.subscribe(test2::onNext); Preference commitTimeout = SystemPreferences.COMMIT_TIMEOUT.toPreference(); commitTimeout.setValue("1111"); preferenceManager.update(Collections.singletonList(commitTimeout)); test1.assertValueCount(1); test2.assertValueCount(1); preferenceManager.delete(commitTimeout.getName()); test1.assertValueCount(2); test2.assertValueCount(2); }