Creates a {@link Predicate} for matching a mail recipient. This Predicate returns true if at least
one recipient matches the given value.

@param recipient
the recipient to match
@return the predicate
498726
public static Predicate<Message> forRecipient(final String recipient) {
		return new Predicate<Message>() {
			@Override
			public boolean apply(final Message input) {
				Address[] addresses;
				try {
					addresses = input.getAllRecipients();
					if (addresses == null) {
						return false;
					}
					for (Address address : addresses) {
						if (StringUtils.equalsIgnoreCase(address.toString(), recipient)) {
							return true;
						}
					}
				} catch (MessagingException e) {
					throw new MailException("Error while reading recipients", e);
				}
				return false;
			}

			@Override
			public String toString() {
				return String.format("recipient to include %s", recipient);
			}
		};
	}
504454
public UserCustomResultSet query(GeometryEnvelope envelope) {
		return query(envelope.getMinX(), envelope.getMinY(),
				envelope.getMaxX(), envelope.getMaxY());
	}
778665
public <T> Predicate<T> in (final Collection<? extends T> target)
    {
        return new Predicate<T>() {
            public boolean apply (T arg) {
                try {
                    return target.contains(arg);
                } catch (NullPointerException e) {
                    return false;
                } catch (ClassCastException e) {
                    return false;
                }
            }
        };
    }
774158
public static <T extends Throwable> Matcher<T> withMessage(String message) {
        return IsThrowable.withMessage(message);
    }
227383
public <E extends Exception> boolean allMatch(Try.BytePredicate<E> filter) throws E {
        return allMatch(0, size(), filter);
    }
670987
public Email cc(EmailAddress... cc) {
		for (EmailAddress c : cc) {
			recipient(c, RecipientType.CC);
		}
		return this;
	}
159536
public static SmtpRequest mail(CharSequence sender, CharSequence... mailParameters) {
        if (mailParameters == null || mailParameters.length == 0) {
            return new DefaultSmtpRequest(SmtpCommand.MAIL,
                                          sender != null ? "FROM:<" + sender + '>' : FROM_NULL_SENDER);
        } else {
            List<CharSequence> params = new ArrayList<CharSequence>(mailParameters.length + 1);
            params.add(sender != null? "FROM:<" + sender + '>' : FROM_NULL_SENDER);
            for (CharSequence param : mailParameters) {
                params.add(param);
            }
            return new DefaultSmtpRequest(SmtpCommand.MAIL, params);
        }
    }
376527
public static <S> boolean the(S subject, Matcher<? super S> criteria) {
        return criteria.matches(subject);
    }
273943
public Predicate create(Filter filter) {
        List<Predicate> predicates = new ArrayList<>(filter.getPredicates().size());

        for (org.cdlflex.fruit.Predicate fp : filter.getPredicates()) {
            predicates.add(create(fp));
        }

        return connect(predicates, filter.getConnective());
    }
1091939
public GetIdentityMailFromDomainAttributesResult withMailFromDomainAttributes(
            java.util.Map<String, IdentityMailFromDomainAttributes> mailFromDomainAttributes) {
        setMailFromDomainAttributes(mailFromDomainAttributes);
        return this;
    }
38727
public static Predicate<MailMessage> forSubjectAndBody(final String subjectPattern, final String bodyPattern) {
		return forSubjectAndBody(Pattern.compile(subjectPattern), Pattern.compile(bodyPattern));
	}
192055
public static <T> Predicate<T> in(final Collection<T> c) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T obj) {
        return c.contains(obj);
      }
    };
  }
1121877
public static <T> boolean xMatch(final Stream<T> stream, final int num, final Predicate<? super T> c) {

        return stream.filter(t -> c.test(t))
                     .collect(java.util.stream.Collectors.counting()) == num;
    }
1322901
public final boolean verifyEventCondition(MessageEnvelope envelope) {
		String message = safeGetQuickReplyPayload(envelope);
		return expectedPattern.matcher(message).matches();
	}
1097984
public static <T> Predicate<T> contains(final Iterable<T> iterable) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return Iterables.contains(iterable, testValue);
            }
        };
    }
1310200
public static Recipient[] toRecipient(EmailAddress[] to) {
		Recipient[] addresses = new Recipient[to.length];
		int i = 0;
		for (EmailAddress t : to) {
			addresses[i++] = new Recipient(t);
		}
		return addresses;
	}
879173
public ArrayList<User> lookupUsersByEmail (String email)
        throws PersistenceException
    {
        return loadAll(_utable, "where email = " + JDBCUtil.escape(email));
    }