public static void assertMatchesRegex(String message, String expected, String actual) {
    if (actual == null) {
      throw new IllegalStateException("Actual == null");
    }
    Pattern pattern = Pattern.compile(expected);
    Matcher matcher = pattern.matcher(actual);
    if (!matcher.matches()) {
      if (message != null) {
        throw new IllegalStateException(message + " " + actual);
      }
      throw new IllegalStateException(actual + " does not match regex " + expected);
    }
  }
This exists to help alleviate some API transition pain
core/src/androidTest/java/com/facebook/testing/screenshot/internal/OldApiBandaid.java