@Test
  public void stringPattern() throws Exception {
    Person john = ImmutablePerson.builder().id("p1").name("John").age(30).build();
    repository.insert(john).getUnchecked();

    check(repository.find(criteria().name("John")).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().name("John123")).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().nameNot("John")).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().nameStartsWith("John")).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameStartsWith("Jo")).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameStartsWith("J")).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameIn("J1", "J2")).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().nameIn("John", "John")).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameNotIn("John", "John")).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().nameNotIn("J1", "J2")).fetchAll().getUnchecked()).hasContentInAnyOrder(john);

    // patterns
    check(repository.find(criteria().nameMatches(Pattern.compile("J.*n"))).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameMatches(Pattern.compile("J\\w+n"))).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameMatches(Pattern.compile("J..n"))).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameMatches(Pattern.compile(".*"))).fetchAll().getUnchecked()).hasContentInAnyOrder(john);
    check(repository.find(criteria().nameNotMatches(Pattern.compile("J.*n"))).fetchAll().getUnchecked()).isEmpty();
  }
This one seems to fail: ageNot(30) should return no result.
mongo/test/org/immutables/mongo/fixture/criteria/PersonCriteriaTest.java