### Question:
AWSIotClientIdHelper { static synchronized String getPersistedClientId(String filesDirectory) throws IOException { File file = new File(filesDirectory, PERSISTENCE_FILE); if (clientId == null) { if (!file.exists()) { persistId(file, generateClientId()); } clientId = readPersistedId(file); } return clientId; } private  AWSIotClientIdHelper();   }### Answer:
@Test public void testGetPersistedClientId() throws Exception { String testId = AWSIotClientIdHelper.getPersistedClientId(TEST_DIRECTORY); assertEquals(36, testId.length()); assertEquals(testId, AWSIotClientIdHelper.getPersistedClientId(TEST_DIRECTORY)); }
@Test public void testGetPersistedClientIdFilePresent() throws Exception { File persistenceFile = new File(TEST_DIRECTORY, PERSISTENCE_FILENAME); FileOutputStream out = new FileOutputStream(persistenceFile); out.write("this-is-a-36-character-string-4-test".getBytes(StringUtils.UTF8)); out.close(); String testId = AWSIotClientIdHelper.getPersistedClientId(TEST_DIRECTORY); assertEquals(36, testId.length()); assertEquals("this-is-a-36-character-string-4-test", testId); }