code: public static boolean isValidEmailAddress(final String email) {
      if (email == null) {
        return false;
      }
  
      boolean result = true;
      try {
        final InternetAddress emailAddr = new InternetAddress(email);
        emailAddr.validate();
      } catch (final AddressException ex) {
        result = false;
      }
      return result;
    }
docs: Returns true if the given email is valid and false otherwise.