@Test public void validEmailAddresses() { Assert.assertTrue(EmailAddressUtil.isValid("simple@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("very.common@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("disposable.style.email.with+symbol@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("other.email-with-hyphen@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("fully-qualified-domain@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("user.name+tag+sorting@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("x@example.com")); Assert.assertTrue(EmailAddressUtil.isValid("example-indeed@strange-example.com")); Assert.assertTrue(EmailAddressUtil.isValid("admin@mailserver1")); Assert.assertTrue(EmailAddressUtil.isValid("example@s.example")); Assert.assertTrue(EmailAddressUtil.isValid("\" \"@example.org")); Assert.assertTrue(EmailAddressUtil.isValid("\"john..doe\"@example.org")); Assert.assertTrue(EmailAddressUtil.isValid("mailhost!username@example.org")); Assert.assertTrue(EmailAddressUtil.isValid("user%example.com@example.org")); }
public static boolean isValid(final EmailAddress emailAddress) { return isValid(emailAddress.getEmail()); }
EmailAddressUtil { public static boolean isValid(final EmailAddress emailAddress) { return isValid(emailAddress.getEmail()); } }
EmailAddressUtil { public static boolean isValid(final EmailAddress emailAddress) { return isValid(emailAddress.getEmail()); }  }
EmailAddressUtil { public static boolean isValid(final EmailAddress emailAddress) { return isValid(emailAddress.getEmail()); }  static String toString(EmailAddress emailAddress); static String toHeaderValue(Collection<EmailAddress> emailAddresses); static boolean equalCollections(final Collection<EmailAddress> a, final Collection<EmailAddress> b); static boolean isValid(final EmailAddress emailAddress); static boolean isValid(final String email); static Collection<EmailAddress> parse(final String userInput); static String shorten(final String input); }
EmailAddressUtil { public static boolean isValid(final EmailAddress emailAddress) { return isValid(emailAddress.getEmail()); }  static String toString(EmailAddress emailAddress); static String toHeaderValue(Collection<EmailAddress> emailAddresses); static boolean equalCollections(final Collection<EmailAddress> a, final Collection<EmailAddress> b); static boolean isValid(final EmailAddress emailAddress); static boolean isValid(final String email); static Collection<EmailAddress> parse(final String userInput); static String shorten(final String input);  }