Adapt to new autovalue factories

Bug: Issue 10842
Change-Id: Ie92c5fea7c3e1764f20d08eda285939743b55099
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java
index cb577c5..6dd3a9a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractor.java
@@ -47,7 +47,7 @@
       try {
         ChangeInfo info =
             gApi.changes()
-                .id(patchSetId.getParentKey().get())
+                .id(patchSetId.changeId().get())
                 .get(EnumSet.of(ListChangesOption.ALL_REVISIONS));
         for (Map.Entry<String, RevisionInfo> e : info.revisions.entrySet()) {
           if (e.getValue()._number == patchSetId.get()) {
@@ -235,8 +235,7 @@
     if (patchSetId != null) {
       Map<String, Set<String>> previous = Maps.newHashMap();
       if (patchSetId.get() != 1) {
-        PatchSet.Id previousPatchSetId =
-            new PatchSet.Id(patchSetId.getParentKey(), patchSetId.get() - 1);
+        PatchSet.Id previousPatchSetId = PatchSet.id(patchSetId.changeId(), patchSetId.get() - 1);
         String previousPatchSet = db.getRevision(previousPatchSetId);
         if (previousPatchSet != null) {
           previous = getIssueIds(projectName, previousPatchSet);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
index 0a1bfd1..4af9348 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractor.java
@@ -70,7 +70,7 @@
    */
   private PatchSet.Id newPatchSetId(String changeId, String patchId) {
     try {
-      return new PatchSet.Id(new Change.Id(Integer.parseInt(changeId)), Integer.parseInt(patchId));
+      return PatchSet.id(Change.id(Integer.parseInt(changeId)), Integer.parseInt(patchId));
     } catch (NumberFormatException e) {
       return null;
     }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java
index 1a147c7..b828604 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/its/ItsConfigTest.java
@@ -53,10 +53,8 @@
       String enabled, String itsProject, String parentEnabled, String[] branches) {
     ProjectState projectState = createMock(ProjectState.class);
 
-    expect(projectCache.get(new Project.NameKey("testProject"))).andReturn(projectState).anyTimes();
-    expect(projectCache.get(new Project.NameKey("parentProject")))
-        .andReturn(projectState)
-        .anyTimes();
+    expect(projectCache.get(Project.nameKey("testProject"))).andReturn(projectState).anyTimes();
+    expect(projectCache.get(Project.nameKey("parentProject"))).andReturn(projectState).anyTimes();
 
     Iterable<ProjectState> parents;
     if (parentEnabled == null) {
@@ -114,7 +112,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -126,7 +124,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -138,7 +136,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -150,7 +148,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -162,7 +160,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -174,7 +172,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -186,7 +184,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -198,7 +196,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -210,7 +208,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -222,7 +220,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -234,7 +232,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -246,7 +244,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -258,7 +256,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -270,7 +268,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertFalse(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -282,7 +280,7 @@
 
     replayMocks();
 
-    Project.NameKey projectNK = new Project.NameKey("testProject");
+    Project.NameKey projectNK = Project.nameKey("testProject");
     assertTrue(itsConfig.isEnabled(projectNK, "refs/heads/testBranch"));
   }
 
@@ -491,7 +489,7 @@
 
     replayMocks();
 
-    assertFalse(itsConfig.getItsProjectName(new Project.NameKey("testProject")).isPresent());
+    assertFalse(itsConfig.getItsProjectName(Project.nameKey("testProject")).isPresent());
   }
 
   public void testGetItsProjectConfigured() {
@@ -502,8 +500,7 @@
 
     replayMocks();
 
-    Optional<String> itsProjectName =
-        itsConfig.getItsProjectName(new Project.NameKey("testProject"));
+    Optional<String> itsProjectName = itsConfig.getItsProjectName(Project.nameKey("testProject"));
     assertTrue(itsProjectName.isPresent());
     assertEquals("itsProject", itsProjectName.get());
   }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/testutil/LoggingMockingTestCase.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/testutil/LoggingMockingTestCase.java
index b1d98e2..fd09d23 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/testutil/LoggingMockingTestCase.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/testutil/LoggingMockingTestCase.java
@@ -16,7 +16,7 @@
 
 import com.google.common.collect.Lists;
 import com.google.gerrit.reviewdb.client.Account;
-import com.google.gerrit.reviewdb.client.Branch;
+import com.google.gerrit.reviewdb.client.BranchNameKey;
 import com.google.gerrit.reviewdb.client.Change;
 import com.google.gerrit.reviewdb.client.Project;
 import com.googlesource.gerrit.plugins.its.base.testutil.log.LogUtil;
@@ -29,9 +29,9 @@
 public abstract class LoggingMockingTestCase extends MockingTestCase {
 
   protected final Change.Key testChangeKey =
-      new Change.Key("Ic19f7bf6c8b4685c363a8204c32d827ffda52ec0");
-  protected final Change.Id testChangeId = new Change.Id(1);
-  protected final Account.Id testAccountId = new Account.Id(1);
+      Change.key("Ic19f7bf6c8b4685c363a8204c32d827ffda52ec0");
+  protected final Change.Id testChangeId = Change.id(1);
+  protected final Account.Id testAccountId = Account.id(1);
 
   private java.util.Collection<LoggingEvent> loggedEvents;
 
@@ -115,7 +115,7 @@
         testChangeKey,
         testChangeId,
         testAccountId,
-        new Branch.NameKey(new Project.NameKey(project), branch),
+        BranchNameKey.create(Project.nameKey(project), branch),
         new Timestamp(System.currentTimeMillis()));
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java
index 80cbfd3..2573fc0 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/IssueExtractorTest.java
@@ -20,7 +20,6 @@
 import com.google.gerrit.extensions.config.FactoryModule;
 import com.google.gerrit.reviewdb.client.Change;
 import com.google.gerrit.reviewdb.client.PatchSet;
-import com.google.gerrit.reviewdb.client.RevId;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.googlesource.gerrit.plugins.its.base.its.ItsConfig;
@@ -36,7 +35,7 @@
 import org.powermock.modules.junit4.PowerMockRunner;
 
 @RunWith(PowerMockRunner.class)
-@PrepareForTest({PatchSet.class, RevId.class})
+@PrepareForTest({PatchSet.class})
 public class IssueExtractorTest extends LoggingMockingTestCase {
   private Injector injector;
   private ItsConfig itsConfig;
@@ -754,7 +753,7 @@
 
     replayMocks();
 
-    PatchSet.Id patchSetId = new PatchSet.Id(new Change.Id(4), 1);
+    PatchSet.Id patchSetId = PatchSet.id(Change.id(4), 1);
     IssueExtractor issueExtractor = injector.getInstance(IssueExtractor.class);
     Map<String, Set<String>> actual =
         issueExtractor.getIssueIds(
@@ -781,7 +780,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(1).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
@@ -814,7 +813,7 @@
         .andReturn("bug#42\n" + "\n" + "Change-Id: I1234567891123456789212345678931234567894");
 
     // Call for previous patch set
-    PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
+    PatchSet.Id previousPatchSetId = PatchSet.id(changeId, 1);
     expect(db.getRevision(previousPatchSetId))
         .andReturn("9876543211987654321298765432139876543214");
 
@@ -825,7 +824,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
@@ -863,7 +862,7 @@
         .andReturn("bug#42\n" + "\n" + "Change-Id: I1234567891123456789212345678931234567894");
 
     // Call for previous patch set
-    PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
+    PatchSet.Id previousPatchSetId = PatchSet.id(changeId, 1);
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -874,7 +873,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
@@ -912,7 +911,7 @@
         .andReturn("bug#42\n" + "\n" + "Change-Id: I1234567891123456789212345678931234567894");
 
     // Call for previous patch set
-    PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
+    PatchSet.Id previousPatchSetId = PatchSet.id(changeId, 1);
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -927,7 +926,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
@@ -969,7 +968,7 @@
                 + "Change-Id: I1234567891123456789212345678931234567894");
 
     // Call for previous patch set
-    PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
+    PatchSet.Id previousPatchSetId = PatchSet.id(changeId, 1);
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -980,7 +979,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
@@ -1027,7 +1026,7 @@
                 + "Change-Id: I1234567891123456789212345678931234567894");
 
     // Call for previous patch set
-    PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
+    PatchSet.Id previousPatchSetId = PatchSet.id(changeId, 1);
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -1042,7 +1041,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
@@ -1097,7 +1096,7 @@
                 + "Change-Id: I1234567891123456789212345678931234567894");
 
     // Call for previous patch set
-    PatchSet.Id previousPatchSetId = new PatchSet.Id(changeId, 1);
+    PatchSet.Id previousPatchSetId = PatchSet.id(changeId, 1);
     expect(
             commitMessageFetcher.fetchGuarded(
                 "testProject", "9876543211987654321298765432139876543214"))
@@ -1113,7 +1112,7 @@
 
     PatchSet.Id currentPatchSetId = createMock(PatchSet.Id.class);
     expect(currentPatchSetId.get()).andReturn(2).anyTimes();
-    expect(currentPatchSetId.getParentKey()).andReturn(changeId).anyTimes();
+    expect(currentPatchSetId.changeId()).andReturn(changeId).anyTimes();
 
     replayMocks();
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractorTest.java
index 0aecd05..0fc929a 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/ItsProjectExtractorTest.java
@@ -35,7 +35,7 @@
   public void test() {
     ItsProjectExtractor projectExtractor = injector.getInstance(ItsProjectExtractor.class);
 
-    expect(itsConfig.getItsProjectName(new Project.NameKey(PROJECT)))
+    expect(itsConfig.getItsProjectName(Project.nameKey(PROJECT)))
         .andReturn(Optional.of(ITS_PROJECT))
         .once();
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java
index 33e8aa6..69ac647 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/util/PropertyExtractorTest.java
@@ -368,7 +368,7 @@
     issueMap.put("4711", Sets.newHashSet("body", "anywhere"));
     issueMap.put("42", Sets.newHashSet("footer", "anywhere"));
     if (withRevision) {
-      PatchSet.Id patchSetId = new PatchSet.Id(new Change.Id(176), 3);
+      PatchSet.Id patchSetId = PatchSet.id(Change.id(176), 3);
       expect(issueExtractor.getIssueIds("testProject", "testRevision", patchSetId))
           .andReturn(issueMap);
     } else {
@@ -438,7 +438,7 @@
 
     @Override
     public NameKey getProjectNameKey() {
-      return new Project.NameKey("testProject");
+      return Project.nameKey("testProject");
     }
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java
index d247a7c..d29457e 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/validation/ItsValidateCommentTest.java
@@ -48,7 +48,7 @@
   private ItsConfig itsConfig;
   private ItsFacadeFactory itsFacadeFactory;
 
-  private Project project = new Project(new Project.NameKey("myProject"));
+  private Project project = new Project(Project.nameKey("myProject"));
 
   public void testOptional() throws CommitValidationException {
     List<CommitValidationMessage> ret;
@@ -503,7 +503,7 @@
 
   private void setupCommonMocks() {
     expect(itsConfig.getIssuePattern()).andReturn(Pattern.compile("bug#(\\d+)")).anyTimes();
-    Project.NameKey projectNK = new Project.NameKey("myProject");
+    Project.NameKey projectNK = Project.nameKey("myProject");
     expect(itsConfig.isEnabled(projectNK, null)).andReturn(true).anyTimes();
   }
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutorTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutorTest.java
index e82ffd1..89d001d 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ActionExecutorTest.java
@@ -60,8 +60,7 @@
     ActionRequest actionRequest = createMock(ActionRequest.class);
     expect(actionRequest.getName()).andReturn("unparsed");
     expect(actionRequest.getUnparsed()).andReturn("unparsed action 1");
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     Set<ActionRequest> actionRequests = ImmutableSet.of(actionRequest);
 
@@ -77,8 +76,7 @@
     ActionRequest actionRequest = createMock(ActionRequest.class);
     expect(actionRequest.getName()).andReturn("unparsed");
     expect(actionRequest.getUnparsed()).andReturn("unparsed action 1");
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     Set<ActionRequest> actionRequests = ImmutableSet.of(actionRequest);
 
@@ -101,7 +99,7 @@
     ActionRequest actionRequest2 = createMock(ActionRequest.class);
     expect(actionRequest2.getName()).andReturn("unparsed");
     expect(actionRequest2.getUnparsed()).andReturn("unparsed action 2");
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project"))))
         .andReturn(its)
         .anyTimes();
 
@@ -128,7 +126,7 @@
     ActionRequest actionRequest3 = createMock(ActionRequest.class);
     expect(actionRequest3.getName()).andReturn("unparsed");
     expect(actionRequest3.getUnparsed()).andReturn("unparsed action 3");
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project"))))
         .andReturn(its)
         .anyTimes();
 
@@ -158,8 +156,7 @@
 
     AddComment addComment = createMock(AddComment.class);
     expect(addCommentFactory.create()).andReturn(addComment);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     addComment.execute(its, "4711", actionRequest, properties);
 
@@ -177,8 +174,7 @@
 
     AddSoyComment addSoyComment = createMock(AddSoyComment.class);
     expect(addSoyCommentFactory.create()).andReturn(addSoyComment);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     addSoyComment.execute(its, "4711", actionRequest, properties);
 
@@ -196,8 +192,7 @@
 
     AddStandardComment addStandardComment = createMock(AddStandardComment.class);
     expect(addStandardCommentFactory.create()).andReturn(addStandardComment);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     addStandardComment.execute(its, "4711", actionRequest, properties);
 
@@ -215,8 +210,7 @@
 
     LogEvent logEvent = createMock(LogEvent.class);
     expect(logEventFactory.create()).andReturn(logEvent);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     logEvent.execute(its, "4711", actionRequest, properties);
 
@@ -233,8 +227,7 @@
     CreateVersionFromProperty createVersionFromProperty =
         createMock(CreateVersionFromProperty.class);
     expect(createVersionFromPropertyFactory.create()).andReturn(createVersionFromProperty);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     createVersionFromProperty.execute(its, "itsTestProject", actionRequest, projectProperties);
 
@@ -252,8 +245,7 @@
 
     AddPropertyToField addPropertyToField = createMock(AddPropertyToField.class);
     expect(addPropertyToFieldFactory.create()).andReturn(addPropertyToField);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     addPropertyToField.execute(its, "4711", actionRequest, properties);
 
@@ -268,8 +260,7 @@
 
     ActionRequest actionRequest = createMock(ActionRequest.class);
     expect(actionRequest.getName()).andReturn(CUSTOM_ACTION_NAME);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     Set<ActionRequest> actionRequests = ImmutableSet.of(actionRequest);
 
@@ -286,8 +277,7 @@
 
     ActionRequest actionRequest = createMock(ActionRequest.class);
     expect(actionRequest.getName()).andReturn(CUSTOM_ACTION_NAME);
-    expect(itsFacadeFactory.getFacade(new Project.NameKey(properties.get("project"))))
-        .andReturn(its);
+    expect(itsFacadeFactory.getFacade(Project.nameKey(properties.get("project")))).andReturn(its);
 
     Set<ActionRequest> actionRequests = ImmutableSet.of(actionRequest);
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheTest.java b/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheTest.java
index 3b33b41..6be2a78 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/its/base/workflow/ItsRulesProjectCacheTest.java
@@ -90,7 +90,7 @@
     ProjectLevelConfig projectLevelConfigPlugin = createMock(ProjectLevelConfig.class);
     expect(projectLevelConfigPlugin.get()).andReturn(new Config());
     expect(projectState.getConfig(RuleBaseKind.ITS.fileName)).andReturn(projectLevelConfigPlugin);
-    expect(projectCache.checkedGet(new Project.NameKey(TEST_PROJECT))).andReturn(projectState);
+    expect(projectCache.checkedGet(Project.nameKey(TEST_PROJECT))).andReturn(projectState);
     expect(rulesConfigReader.getRulesFromConfig(isA(Config.class)))
         .andReturn(ImmutableList.of(rule1))
         .andReturn(ImmutableList.of());
@@ -134,7 +134,7 @@
     expect(parentProjectState.getConfig(RuleBaseKind.ITS.fileName))
         .andReturn(parentProjectConfigPlugin);
     expect(projectState.parents()).andReturn(FluentIterable.of(parentProjectState));
-    expect(projectCache.checkedGet(new Project.NameKey(TEST_PROJECT))).andReturn(projectState);
+    expect(projectCache.checkedGet(Project.nameKey(TEST_PROJECT))).andReturn(projectState);
 
     expect(rulesConfigReader.getRulesFromConfig(isA(Config.class)))
         .andReturn(ImmutableList.of())