Replace PreferencesTest with Kotlin version