code: public static String getEmailDomain(final String email) {
      if (email == null || email.isEmpty()) {
        return null;
      }
  
      final int atSignIndex = email.indexOf('@');
      if (atSignIndex != -1) {
        return email.substring(atSignIndex + 1);
      }
  
      return null;
    }
docs: Given an email string, returns the domain part if it exists, and null
  otherwise.