@Test public void validate_notValid() { for (String email : INVALID_EMAILS) { assertFalse(email + " should be invalid", EmailValidator.isValid(email)); } }
public static boolean isValid(String email) { return email == null || (email.length() <= EMAIL_MAX_LENGTH && PATTERN.matcher(email).matches()); }
EmailValidator { public static boolean isValid(String email) { return email == null || (email.length() <= EMAIL_MAX_LENGTH && PATTERN.matcher(email).matches()); } }
EmailValidator { public static boolean isValid(String email) { return email == null || (email.length() <= EMAIL_MAX_LENGTH && PATTERN.matcher(email).matches()); }  }
EmailValidator { public static boolean isValid(String email) { return email == null || (email.length() <= EMAIL_MAX_LENGTH && PATTERN.matcher(email).matches()); }  static boolean isValid(String email); }
EmailValidator { public static boolean isValid(String email) { return email == null || (email.length() <= EMAIL_MAX_LENGTH && PATTERN.matcher(email).matches()); }  static boolean isValid(String email); static final int EMAIL_MAX_LENGTH; static final String EMAIL_PATTERN; }