### Question:
ClientContext { public static String getInstallationId(Context context) { final SharedPreferences sp = context.getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE); String installationId = sp.getString("installation_id", null); if (installationId == null) { installationId = UUID.randomUUID().toString(); sp.edit().putString("installation_id", installationId).commit(); } return installationId; } ClientContext(Context context); static String getInstallationId(Context context); void putCustomContext(Map<String, String> map); void putServiceContext(String service, Map<String, String> map); String toBase64String();  }### Answer:
@Test public void testinstallationId() { String installationId = ClientContext.getInstallationId(activity); assertNotNull("always has installation id", installationId); assertTrue("matches UUID pattern", installationId.matches("\\w+-\\w+-\\w+-\\w+-\\w+")); }
@Test public void testinstallationIdExist() { SharedPreferences sp = activity.getSharedPreferences(ClientContext.SHARED_PREFERENCES, Context.MODE_PRIVATE); String installationId = "2d9a130e-1c3b-40c7-8953-c7c4aea3d6fa"; sp.edit().putString("installation_id", installationId).commit(); assertEquals(installationId, ClientContext.getInstallationId(activity)); }