### Question:
PreferencesProvider { @Nullable public synchronized String getRegistrationId() { OPFLog.logMethod(); updateAppVersion(); return preferences.getString(KEY_REGISTRATION_ID); } private  PreferencesProvider(@NonNull final Context context); @SuppressWarnings("PMD.NonThreadSafeSingleton") @NonNull static PreferencesProvider getInstance(@NonNull final Context context); @Nullable synchronized String getRegistrationId(); synchronized void saveRegistrationId(@Nullable final String registrationId); synchronized boolean isAuthenticationFailed(); synchronized void saveAuthenticationFailedFlag(); synchronized void removeAuthenticationFailedFlag(); synchronized void reset(); static final int NO_SAVED_APP_VERSION; }### Answer:
@Test public void testGetRegistrationId() { String expected; for (int i = 0; i < NUM_TESTS; ++i) { expected = String.format("id%d", i); preferences.put(KEY_REGISTRATION_ID, expected); assertEquals(expected, preferencesProvider.getRegistrationId()); } }