@Test public void returnsSameValueEveryTime() { String firstValue = provider.getInstallID(); String secondValue = provider.getInstallID(); assertThat(firstValue, equalTo(secondValue)); }
@Override public String getInstallID() { if (sharedPreferences.contains(preferencesKey)) { return sharedPreferences.getString(preferencesKey, null); } else { return generateAndStoreInstallID(); } }
SharedPreferencesInstallIDProvider implements InstallIDProvider { @Override public String getInstallID() { if (sharedPreferences.contains(preferencesKey)) { return sharedPreferences.getString(preferencesKey, null); } else { return generateAndStoreInstallID(); } } }
SharedPreferencesInstallIDProvider implements InstallIDProvider { @Override public String getInstallID() { if (sharedPreferences.contains(preferencesKey)) { return sharedPreferences.getString(preferencesKey, null); } else { return generateAndStoreInstallID(); } } SharedPreferencesInstallIDProvider(SharedPreferences sharedPreferences, String preferencesKey); }
SharedPreferencesInstallIDProvider implements InstallIDProvider { @Override public String getInstallID() { if (sharedPreferences.contains(preferencesKey)) { return sharedPreferences.getString(preferencesKey, null); } else { return generateAndStoreInstallID(); } } SharedPreferencesInstallIDProvider(SharedPreferences sharedPreferences, String preferencesKey); @Override String getInstallID(); }
SharedPreferencesInstallIDProvider implements InstallIDProvider { @Override public String getInstallID() { if (sharedPreferences.contains(preferencesKey)) { return sharedPreferences.getString(preferencesKey, null); } else { return generateAndStoreInstallID(); } } SharedPreferencesInstallIDProvider(SharedPreferences sharedPreferences, String preferencesKey); @Override String getInstallID();  }