code: public static Predicate<Throwable> throwableContainsMessage(final String expected, final boolean caseSensitive) {
          return new Predicate<Throwable>() {
              public boolean apply(Throwable input) {
                  String actual = input.getMessage();
                  String exp = expected;
                  if (! caseSensitive) {
                      actual = actual.toLowerCase();
                      exp = exp.toLowerCase();
                  }
                  return actual.contains(exp);
              }
          };
      }
docs: *
  Create a predicate to check if a throwable's error message contains a specific string.
  
  @param expected The expected string
  @param caseSensitive Is the comparison going to be case sensitive
  
  @return True if the throwable's message contains the expected string.