### Question:
EmailHelper { public static String getDomainFromEmailAddress(String email) { int separatorIndex = email.lastIndexOf('@'); if (separatorIndex == -1 || separatorIndex + 1 == email.length()) { return null; } return email.substring(separatorIndex + 1); } private  EmailHelper(); static String getDomainFromEmailAddress(String email);  }### Answer:
@Test public void getDomainFromEmailAddress_withRegularEmail_shouldReturnsDomain() { String result = EmailHelper.getDomainFromEmailAddress("user@domain.com"); assertEquals("domain.com", result); }
@Test public void getDomainFromEmailAddress_withInvalidEmail_shouldReturnNull() { String result = EmailHelper.getDomainFromEmailAddress("user"); assertNull(result); }
@Test public void getDomainFromEmailAddress_withTLD_shouldReturnDomain() { String result = EmailHelper.getDomainFromEmailAddress("user@domain"); assertEquals("domain", result); }