NameAnonymizer { public long anonymizeProjectName(@NonNull String projectName) { try { return mProjects.get(projectName).mId; } catch (ExecutionException e) { return 0; } } NameAnonymizer(); long anonymizeProjectName(@NonNull String projectName); long anonymizeVariant(@NonNull String projectName, @Nullable String variantName);  }
@Test public void anonymizeProjectName() { NameAnonymizer nameAnonymizer = new NameAnonymizer(); assertEquals(nameAnonymizer.anonymizeProjectName(":a"), nameAnonymizer.anonymizeProjectName(":a")); assertEquals(nameAnonymizer.anonymizeProjectName(":b"), nameAnonymizer.anonymizeProjectName(":b")); assertEquals(nameAnonymizer.anonymizeProjectName(":c"), nameAnonymizer.anonymizeProjectName(":c")); assertNotEquals(nameAnonymizer.anonymizeProjectName(":a"), nameAnonymizer.anonymizeProjectName(":b")); assertNotEquals(nameAnonymizer.anonymizeProjectName(":a"), nameAnonymizer.anonymizeProjectName(":c")); assertNotEquals(nameAnonymizer.anonymizeProjectName(":b"), nameAnonymizer.anonymizeProjectName(":c")); }