Preferences { public boolean isFirstUse() { if (isFirstBackup() && !preferences.contains(FIRST_USE.key)) { preferences.edit().putBoolean(FIRST_USE.key, false).commit(); return true; } else { return false; } } Preferences(Context context);  Preferences(Context context, SharedPreferences preferences); DataTypePreferences getDataTypePreferences(); boolean isAppLogEnabled(); boolean isAppLogDebug(); ContactGroup getBackupContactGroup(); boolean isCallLogCalendarSyncEnabled(); boolean isCallLogBackupAfterCallEnabled(); int getCallLogCalendarId(); CallLogTypes getCallLogType(); boolean isRestoreStarredOnly(); String getReferenceUid(); void setReferenceUid(String referenceUid); boolean getMailSubjectPrefix(); int getMaxItemsPerSync(); int getMaxItemsPerRestore(); boolean isWifiOnly(); boolean isAllow3rdPartyIntegration(); boolean isAutoBackupEnabled(); int getIncomingTimeoutSecs(); int getRegularTimeoutSecs(); MarkAsReadTypes getMarkAsReadType(); boolean getMarkAsReadOnRestore(); AddressStyle getEmailAddressStyle(); boolean isFirstBackup(); boolean isFirstUse(); void setSmsDefaultPackage(String smsPackage); String getSmsDefaultPackage(); boolean hasSeenSmsDefaultPackageChangeDialog(); void setSeenSmsDefaultPackageChangeDialog(); void reset(); boolean isNotificationEnabled(); boolean confirmAction(); boolean shouldShowAboutDialog(); boolean isUseOldScheduler(); void setUseOldScheduler(boolean enabled); @StyleRes int getAppTheme(); void migrate();  }
@Test public void shouldTestForFirstUse() throws Exception { assertThat(preferences.isFirstUse()).isTrue(); assertThat(preferences.isFirstUse()).isFalse(); }