### Question:
SyncKeyFactory { public SyncKey randomSyncKey() { return new SyncKey(uuidFactory.randomUUID().toString()); } @Inject @VisibleForTesting  SyncKeyFactory(UUIDFactory uuidFactory); SyncKey randomSyncKey();  }### Answer:
@Test public void testNotNull() { assertThat(syncKeyFactory.randomSyncKey()).isNotNull(); }
@Test public void testNotEmtpy() { SyncKey randomSyncKey = syncKeyFactory.randomSyncKey(); assertThat(randomSyncKey.getSyncKey()).isNotNull(); assertThat(randomSyncKey.getSyncKey()).isNotEmpty(); }
@Test public void testNotSameKeyForMillionsGeneration() { int syncKeyGenerationCount = 1000000; List<SyncKey> allGeneratedSyncKeys = Lists.newArrayListWithExpectedSize(syncKeyGenerationCount); for (int count = 0; count < syncKeyGenerationCount; count++) { allGeneratedSyncKeys.add(syncKeyFactory.randomSyncKey()); } assertThat(allGeneratedSyncKeys).doesNotHaveDuplicates(); }