Source:
public void addOverlappingGroups ( ) throws java.lang.Exception { java.lang.String emailPrefix = "addOverlappingGroups-" ; com.google.gerrit.acceptance.TestAccount user1 = accounts.create ( name ( "user1" ) , ( emailPrefix + "user1@example.com" ) , "User1" ) ; com.google.gerrit.acceptance.TestAccount user2 = accounts.create ( name ( "user2" ) , ( emailPrefix + "user2@example.com" ) , "User2" ) ; com.google.gerrit.acceptance.TestAccount user3 = accounts.create ( name ( "user3" ) , ( emailPrefix + "user3@example.com" ) , "User3" ) ; java.lang.String group1 = createGroup ( "group1" ) ; java.lang.String group2 = createGroup ( "group2" ) ; gApi.groups ( ) . id ( group1 ) . addMembers ( user1.username , user2.username ) ; gApi.groups ( ) . id ( group2 ) . addMembers ( user2.username , user3.username ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput input = com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) . reviewer ( group1 ) . reviewer ( group2 ) ; com.google.gerrit.extensions.api.changes.ReviewResult result = review ( r.getChangeId ( ) , r.getCommit ( ) . name ( ) , input ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . hasSize ( 2 ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult reviewerResult = result.reviewers.get ( group1 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group2 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . hasSize ( 1 ) ; if ( ! ( notesMigration.readChanges ( ) ) ) { return ; } r = createChange ( ) ; input = com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) . reviewer ( group1 , com.google.gerrit.extensions.client.ReviewerState.CC , false ) . reviewer ( group2 , com.google.gerrit.extensions.client.ReviewerState.CC , false ) ; result = review ( r.getChangeId ( ) , r.getCommit ( ) . name ( ) , input ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group1 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.ccs ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group2 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.ccs ) . hasSize ( 1 ) ; r = createChange ( ) ; input = com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) . reviewer ( group1 , com.google.gerrit.extensions.client.ReviewerState.REVIEWER , false ) . reviewer ( group2 , com.google.gerrit.extensions.client.ReviewerState.CC , false ) ; result = review ( r.getChangeId ( ) , r.getCommit ( ) . name ( ) , input ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group1 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group2 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.ccs ) . hasSize ( 1 ) ; }

Target:
public void addOverlappingGroups ( ) throws java.lang.Exception { java.lang.String emailPrefix = "addOverlappingGroups-" ; com.google.gerrit.acceptance.TestAccount user1 = accountCreator.create ( name ( "user1" ) , ( emailPrefix + "user1@example.com" ) , "User1" ) ; com.google.gerrit.acceptance.TestAccount user2 = accountCreator.create ( name ( "user2" ) , ( emailPrefix + "user2@example.com" ) , "User2" ) ; com.google.gerrit.acceptance.TestAccount user3 = accountCreator.create ( name ( "user3" ) , ( emailPrefix + "user3@example.com" ) , "User3" ) ; java.lang.String group1 = createGroup ( "group1" ) ; java.lang.String group2 = createGroup ( "group2" ) ; gApi.groups ( ) . id ( group1 ) . addMembers ( user1.username , user2.username ) ; gApi.groups ( ) . id ( group2 ) . addMembers ( user2.username , user3.username ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput input = com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) . reviewer ( group1 ) . reviewer ( group2 ) ; com.google.gerrit.extensions.api.changes.ReviewResult result = review ( r.getChangeId ( ) , r.getCommit ( ) . name ( ) , input ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . hasSize ( 2 ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult reviewerResult = result.reviewers.get ( group1 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group2 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . hasSize ( 1 ) ; if ( ! ( notesMigration.readChanges ( ) ) ) { return ; } r = createChange ( ) ; input = com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) . reviewer ( group1 , com.google.gerrit.extensions.client.ReviewerState.CC , false ) . reviewer ( group2 , com.google.gerrit.extensions.client.ReviewerState.CC , false ) ; result = review ( r.getChangeId ( ) , r.getCommit ( ) . name ( ) , input ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group1 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.ccs ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group2 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.ccs ) . hasSize ( 1 ) ; r = createChange ( ) ; input = com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) . reviewer ( group1 , com.google.gerrit.extensions.client.ReviewerState.REVIEWER , false ) . reviewer ( group2 , com.google.gerrit.extensions.client.ReviewerState.CC , false ) ; result = review ( r.getChangeId ( ) , r.getCommit ( ) . name ( ) , input ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group1 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . hasSize ( 2 ) ; reviewerResult = result.reviewers.get ( group2 ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.error ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.reviewers ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( reviewerResult.ccs ) . hasSize ( 1 ) ; }