class 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;
    }

}