Add tests for the ClassCastException fix for SharedPrefs