src/main/java/io/github/glytching/junit/extension/exception/ExpectedExceptionExtension.java
private Predicate<String> getPredicate(ExpectedException annotation) {
    if (has(annotation.messageStartsWith())) {
      return s -> s.startsWith(annotation.messageStartsWith());
    } else if (has(annotation.messageContains())) {
      return s -> s.contains(annotation.messageContains());
    } else if (has(annotation.messageIs())) {
      return s -> s.equals(annotation.messageIs());
    } else {
      // the default
      return s -> true;
    }
  }
private Predicate<String> getPredicate(ExpectedException annotation) {
    if (has(annotation.messageStartsWith())) {
      return s -> s.startsWith(annotation.messageStartsWith());
    } else if (has(annotation.messageContains())) {
      return s -> s.contains(annotation.messageContains());
    } else if (has(annotation.messageIs())) {
      return s -> s.equals(annotation.messageIs());
    } else {
      // the default
      return s -> true;
    }
  }
Maps the expectations expressed in the given {@code annotation} to a {@link Predicate}.

@param annotation encapsulates the callers' expression of what's to be deemed an acceptable
exception
@return a predicate which can be used to assess whether an exception matches the expectations
expressed in the given {@code annotation}