### Question:
Settings { public void setIsSpywareEnabled(boolean value) { prefs.putBoolean(PREF_KEY_SPYWARE_ENABLED, value); } Settings(Preferences prefs); static Settings getDefaultSettings(); String getExerciseFilePath(); void setExerciseFilePath(String exerciseFilePath); String getServerBaseUrl(); void setServerBaseUrl(String serverBaseUrl); String getUsername(); void setUsername(String username); void setLoggedIn(boolean isloggedIn); boolean isLoggedIn(); String getPassword(); void setPassword(String password); String getCurrentCourseName(); void setCurrentCourseName(String currentCourseName); boolean isCheckingForUpdatesInTheBackground(); void setCheckingForUpdatesInTheBackground(boolean value); boolean isCheckingForUnopenedAtStartup(); void setCheckingForUnopenedAtStartup(boolean value); boolean isSpywareEnabled(); void setIsSpywareEnabled(boolean value); boolean isDetailedSpywareEnabled(); void setIsDetailedSpywareEnabled(boolean value); boolean isSavePassword(); void setSavePassword(boolean value); int getDefaultLocaleNum(); String[] getAvailableLocales(); boolean save(); Locale getErrorMsgLocale(); int getErrorMsgLocaleNum(); void setErrorMsgLocale(int localeNum); static final String PREF_KEY_TMC_SERVER_URL; static final String PREF_KEY_USERNAME; static final String PREF_KEY_PASSWORD; static final String PREF_KEY_CURRENT_COURSE; static final String PREF_KEY_EXERCISE_FILEPATH; static final String PREF_KEY_CHECK_FOR_UPDATES_IN_BACKGROUND; static final String PREF_KEY_CHECK_FOR_UNOPENED_AT_STARTUP; static final String PREF_KEY_SPYWARE_ENABLED; static final String PREF_KEY_DETAILED_SPYWARE_ENABLED; static final String PREF_ERROR_MSG_LOCALE; static final String[] AVAILABLE_LOCALES; static final int DEFAULT_LOCALE_NUM; static final String PREF_KEY_SAVE_PASSWORD; static final String PREF_KEY_IS_LOGGED_IN; }### Answer:
@Test public void canSaveSpywareEnabled() { settings.setIsSpywareEnabled(true); verify(prefs, times(1)).putBoolean(Settings.PREF_KEY_SPYWARE_ENABLED, true); verifyNoMoreInteractions(prefs); }