### Question:
GitUtils { public RevCommit getCommit(Repository repo, String revstr) throws MissingObjectException, IncorrectObjectTypeException, AmbiguousObjectException, IOException { ObjectId ref = repo.resolve(revstr); if (ref==null) return null; RevWalk walk = new RevWalk(repo); try { return walk.parseCommit(ref); } finally { walk.dispose(); } }  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 testGetCommit() throws Exception { assertThat(gitUtils.getCommit(test, "HEAD").getFullMessage()).isEqualTo("C3\n"); assertThat(gitUtils.getCommit(test, "HEAD^").getFullMessage()).isEqualTo("C2\n"); assertThat(gitUtils.getCommit(test, "46568aa0ac7a12c9e4fa9194b9e2a65d4a132a2c").getFullMessage()).isEqualTo("C1\n"); }
@Test public void testGetCommit_notFound() throws Exception { assertThat(gitUtils.getCommit(test, "46568aa0ac7a12c9e4fa9194b9e2a65d4a132a2c^")).isNull(); }