[#LIB-236] Increase type safety of method PreferencesUtils.storeDiff(prefs, key, prev, val)