public static void assertExceptionContains(Throwable e, String contains) {
    String message =
        String.format(
            "Got exception with message \"%s\", expected it to contain \"%s\".",
            e.getMessage(), contains);
    assertTrue(message, e.getMessage().contains(contains));
  }
Assertion that an exception's message contains the right message. When this fails, the
exception's message and the expected value will be in the failure log.
java_src/src/main/java/com/google/crypto/tink/testing/TestUtil.java