public void matches(@Nullable String regex) {
    checkNotNull(regex);
    if (actual == null) {
      failWithActual("expected a string that matches", regex);
    } else if (!actual.matches(regex)) {
      if (regex.equals(actual)) {
        failWithoutActual(
            fact("expected to match", regex),
            fact("but was", actual),
            simpleFact("Looks like you want to use .isEqualTo() for an exact equality assertion."));
      } else if (Platform.containsMatch(actual, regex)) {
        failWithoutActual(
            fact("expected to match", regex),
            fact("but was", actual),
            simpleFact("Did you mean to call containsMatch() instead of match()?"));
      } else {
        failWithActual("expected to match", regex);
      }
    }
  }
@Test
  @GwtIncompatible("Pattern")
  public void stringMatchesPatternWithFail() {
    expectFailureWhenTestingThat("abcaqadev").matches(Pattern.compile(".*aaa.*"));
    assertFailureValue("expected to match", ".*aaa.*");
  }