### Question:
GitUtils { public void addRemote(Repository toConfigure, String name, Repository remoteRepo) throws IOException { final String refSpec = String.format(REF_SPEC_PATTERN, name); File dest = remoteRepo.getDirectory(); if (!remoteRepo.isBare()) { dest = dest.getParentFile(); } synchronized (toConfigure) { toConfigure.getConfig().setString("remote", name, "fetch", refSpec ); toConfigure.getConfig().setString("remote", name, "url", dest.getAbsolutePath()); toConfigure.getConfig().save(); } }  void addRemote(Repository toConfigure, String name, Repository remoteRepo); void fetch(Repository repository, String remote); RevCommit getCommit(Repository repo, String revstr); boolean containsCommit(Repository repository, String revstr); byte[] showBytes(Repository repository, String revstr); String show(Repository repository, String revstr); boolean isSha1(String candidate); Repository createRepository(File fullPath); String getTree(Repository repo, String commitSha1); void checkoutAsBranch(Repository repository, String commitSha1,
			String branchName);  }### Answer:
@Test public void testAddRemote() throws Exception { gitUtils.addRemote(clone, "copy", test); Git.wrap(clone).fetch().setRemote("copy").call(); assertThat(FilesUtils.tail(new File(clone.getWorkTree(), ".git/config"), 3)).isEqualTo( "[remote \"copy\"]\n" + "\tfetch = +refs/heads/*:refs/remotes/copy/*\n" + "\turl = "+test.getDirectory().getParentFile().getAbsolutePath()+"\n" ); }