MailAddressUtils { public static boolean isUnalteredOrReversePathOrSender(MailAddress mailAddress) { return mailAddress.equals(SpecialAddress.UNALTERED) || mailAddress.equals(SpecialAddress.REVERSE_PATH) || mailAddress.equals(SpecialAddress.SENDER); }  static List<MailAddress> from(InternetAddress[] internetAddresses); static List<InternetAddress> toInternetAddresses(List<MailAddress> mailAddresses); static InternetAddress[] toInternetAddressArray(List<MailAddress> mailAddresses); static boolean isUnalteredOrReversePathOrSender(MailAddress mailAddress);  }
@Test void isUnalteredOrReversePathOrSenderShouldReturnTrueWhenMailAddressIsSpecialUnaltered() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.UNALTERED); assertThat(unalteredOrReversePathOrSender).isTrue(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnTrueWhenMailAddressIsSpecialReversePath() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.REVERSE_PATH); assertThat(unalteredOrReversePathOrSender).isTrue(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnTrueWhenMailAddressIsSpecialSender() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.SENDER); assertThat(unalteredOrReversePathOrSender).isTrue(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsSpecialDelete() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.DELETE); assertThat(unalteredOrReversePathOrSender).isFalse(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsSpecialFrom() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.FROM); assertThat(unalteredOrReversePathOrSender).isFalse(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsSpecialNull() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.NULL); assertThat(unalteredOrReversePathOrSender).isFalse(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsSpecialRecipients() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.RECIPIENTS); assertThat(unalteredOrReversePathOrSender).isFalse(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsSpecialReplyTo() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.REPLY_TO); assertThat(unalteredOrReversePathOrSender).isFalse(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsSpecialTo() { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(SpecialAddress.TO); assertThat(unalteredOrReversePathOrSender).isFalse(); }
@Test void isUnalteredOrReversePathOrSenderShouldReturnFalseWhenMailAddressIsNotSpecial() throws Exception { boolean unalteredOrReversePathOrSender = MailAddressUtils.isUnalteredOrReversePathOrSender(new MailAddress("common", "james.org")); assertThat(unalteredOrReversePathOrSender).isFalse(); }