code: public static Predicate<MailMessage> forSubjectAndBody(final Pattern subjectPattern, final Pattern bodyPattern) {
  		return new Predicate<MailMessage>() {
  			@Override
  			public boolean apply(final MailMessage input) {
  				boolean result = subjectPattern.matcher(input.getSubject()).matches();
  				return result && bodyPattern.matcher(input.getText()).matches();
  			}
  
  			@Override
  			public String toString() {
  				return String.format("subject to match pattern '%s' and body to match pattern '%s'",
  						subjectPattern, bodyPattern);
  			}
  		};
  	}
docs: Creates a {@link Predicate} for matching subject and body.
  
  @param subjectPattern
  the regex pattern the subject must match
  @param bodyPattern
  the regex pattern the body must match
  @return the predicate