### Question:
PreferencesProvider { @Nullable public synchronized String getRegistrationId() { OPFLog.logMethod(); if (getAppVersion() == OPFUtils.getAppVersion(preferences.getContext())) { return preferences.getString(KEY_REGISTRATION_ID); } else { saveRegistrationId(null); return null; } } private  PreferencesProvider(@NonNull final Context context); @NonNull static PreferencesProvider getInstance(@NonNull final Context context); @Nullable synchronized String getRegistrationId(); synchronized void saveRegistrationId(@Nullable final String registrationId); 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()); } }