### Question:
GitProctorUtils { @VisibleForTesting static String determineAuthorIdFromNameAndEmail(final String name, final String email) { if (email.contains("@")) { return StringUtils.split(email, "@")[0]; } else { return name; } } private  GitProctorUtils(); @CheckForNull static String resolveSvnMigratedRevision(@Nullable final Revision revision, final String branch); static String determineAuthorId(final RevCommit commit); static final int DEFAULT_GIT_PULL_PUSH_TIMEOUT_SECONDS; static final int DEFAULT_GIT_CLONE_TIMEOUT_SECONDS; }### Answer:
@Test public void testDetermineAuthorId_manualCommits() { assertThat(determineAuthorIdFromNameAndEmail("Foo Bar", "foo@example.com")) .isEqualTo("foo"); }
@Test public void testDetermineAuthorId_proctorWebapp() { assertThat(determineAuthorIdFromNameAndEmail("foo", "foo")) .isEqualTo("foo"); }
@Test public void testDetermineAuthorId_manualCommitsWithoutEmail() { assertThat(determineAuthorIdFromNameAndEmail("Foo Bar", "")) .isEqualTo("Foo Bar"); assertThat(determineAuthorIdFromNameAndEmail("Foo Bar", "this-is-not-email")) .isEqualTo("Foo Bar"); }