### Question:
RevCommitBuilder { public RevCommit build() { if (treeId == null) { throw new IllegalStateException("No tree id set"); } if (platform == null) { platform = new DefaultPlatform(); } final long now = platform.currentTimeMillis(); final int tzOffset = platform.timeZoneOffset(now); long committerTs = committerTimestamp == null ? now : committerTimestamp; int committerOffset = committerTimeZoneOffset == null ? tzOffset : committerTimeZoneOffset; long authorTs = authorTimestamp == null ? committerTs : authorTimestamp; int authorOffset = authorTimeZoneOffset == null ? committerOffset : authorTimeZoneOffset; final ObjectId treeId = this.treeId; final List<ObjectId> parentIds = this.parentIds == null ? new ArrayList<>() : this.parentIds; final RevPerson author = RevPerson.builder().build(this.author, authorEmail, authorTs, authorOffset); final RevPerson committer = RevPerson.builder().build(this.committer, committerEmail, committerTs, committerOffset); final String commitMessage = this.message == null ? "" : this.message; return build(treeId, parentIds, author, committer, commitMessage); } RevCommitBuilder(); RevCommitBuilder init(@NonNull RevCommit copy); RevCommit build(); RevCommit build(@NonNull ObjectId treeId, @NonNull List<ObjectId> parents,
            @NonNull RevPerson author, @NonNull RevPerson committer, @NonNull String message);  }### Answer:
@Test public void testPassingNullToSetParentIds() throws Exception { RevCommitBuilder b = RevCommit.builder(); b.author("groldan"); b.authorEmail("groldan@test.com"); b.committer("jdeolive"); b.committerEmail("jdeolive@test.com"); b.message("cool this works"); b.authorTimestamp(1000L); ObjectId treeId = hashString("fake tree content"); b.treeId(treeId); b.parentIds(null); assertEquals(ImmutableList.of(), b.build().getParentIds()); }
@Test public void testNoMessage() throws Exception { RevCommitBuilder b = RevCommit.builder(); b.author("groldan"); b.authorEmail("groldan@test.com"); b.committer("jdeolive"); b.committerEmail("jdeolive@test.com"); b.message(null); b.authorTimestamp(1000L); ObjectId treeId = hashString("fake tree content"); b.treeId(treeId); ObjectId parentId1 = hashString("fake parent content 1"); ObjectId parentId2 = hashString("fake parent content 2"); List<ObjectId> parentIds = ImmutableList.of(parentId1, parentId2); b.parentIds(parentIds); assertEquals(null, b.message()); RevCommit commit2 = b.build(); assertEquals("", commit2.getMessage()); }
@Test public void testNoAuthorTimeStamp() throws Exception { RevCommitBuilder b = RevCommit.builder(); b.author("groldan"); b.authorEmail("groldan@test.com"); b.committer("jdeolive"); b.committerEmail("jdeolive@test.com"); b.committerTimestamp(1000L); b.message("cool this works"); b.treeId(hashString("some tree id")); assertEquals(1000, b.build().getAuthor().getTimestamp()); }