Source:
public void testFollowMatchingBranch ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p = createProject ( "a" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String gitmodules = ( ( ( "" + ( ( "[submodule \"a\"]\n" + "path = a\n" ) + "url = ssh://localhost/" ) ) + ( p.get ( ) ) ) + "\n" ) + "branch = .\n" ; cfg.fromText ( gitmodules ) ; java.lang.String thisServer = com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , thisServer , targetBranch ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "master" ) , "a" ) ) ; com.google.common.truth.Truth.assertThat ( res ) . containsExactlyElementsIn ( expected ) ; }

Target:
public void testFollowMatchingBranch ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey p = createProject ( "a" ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( ( ( ( "" + ( ( "[submodule \"a\"]\n" + "path = a\n" ) + "url = ssh://localhost/" ) ) + ( p.get ( ) ) ) + "\n" ) + "branch = .\n" ) ) ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch1 = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "master" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res1 = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER , targetBranch1 ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected1 = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch1 , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "master" ) , "a" ) ) ; com.google.common.truth.Truth.assertThat ( res1 ) . containsExactlyElementsIn ( expected1 ) ; com.google.gerrit.reviewdb.client.Branch.NameKey targetBranch2 = new com.google.gerrit.reviewdb.client.Branch.NameKey ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) , "somebranch" ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > res2 = new com.google.gerrit.server.util.SubmoduleSectionParser ( projectCache , cfg , com.google.gerrit.acceptance.git.SubmoduleSectionParserIT.THIS_SERVER , targetBranch2 ) . parseAllSections ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > expected2 = com.google.common.collect.Sets.newHashSet ( new com.google.gerrit.reviewdb.client.SubmoduleSubscription ( targetBranch2 , new com.google.gerrit.reviewdb.client.Branch.NameKey ( p , "somebranch" ) , "a" ) ) ; com.google.common.truth.Truth.assertThat ( res2 ) . containsExactlyElementsIn ( expected2 ) ; }