### Question:
GcmController { public String getRegistrationId() { return mSharedPreferences.getString(PROPERTY_GCM_REG_ID, ""); } GcmController(AppConfig appConfig, SharedPreferences sharedPreferences); String getSenderId(); String getRegistrationId(); void storeRegistrationId(String id); static final String OS_ANDROID; static final String PROPERTY_GCM_REG_ID; static final String PREF_SENDER_ID; }### Answer:
@Test public void getRegistrationId() { when(mSharedPreferences.getString(GcmController.PROPERTY_GCM_REG_ID, "")) .thenReturn(TEST_ID); String regId = mController.getRegistrationId(); assertEquals(regId, TEST_ID); }