@Test
  public void negation() throws Exception {
    Date dob = new Date();
    Person john = ImmutablePerson.builder().id("p1").name("John").age(30).aliases(Collections.singleton("a1"))
            .dateOfBirth(dob).build();
    repository.insert(john).getUnchecked();


    // id
    check(repository.find(criteria().idNot(john.id())).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().idNot("__BAD__")).fetchAll().getUnchecked()).hasSize(1);
    check(repository.find(criteria().idNotIn(john.id(), "aaa")).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().idNotIn(Collections.singleton(john.id()))).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().idNotIn(Collections.singleton("__BAD__"))).fetchAll().getUnchecked()).hasSize(1);

    // name
    check(repository.find(criteria().nameNot(john.name())).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().nameNotMatches(Pattern.compile("J..n"))).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().nameNotMatches(Pattern.compile("A...B"))).fetchAll().getUnchecked()).hasSize(1);

    // age this seems to be a bug (?)
    // check(repository.find(repository.criteria().ageNot(john.age())).fetchAll().getUnchecked()).isEmpty();

    check(repository.find(criteria().ageNotIn(john.age(), john.age())).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().ageNotIn(Collections.singleton(john.age()))).fetchAll().getUnchecked()).isEmpty();
    check(repository.find(criteria().ageNotIn(Range.open(john.age() + 1, john.age() + 2))).fetchAll().getUnchecked()).hasSize(1);

    check(repository.find(criteria().aliasesNonEmpty()).fetchAll().getUnchecked()).hasSize(1);

    check(repository.find(criteria().dateOfBirthNot(dob)).fetchAll().getUnchecked()).isEmpty();
  }
This one seems to fail: ageNot(30) should return no result.
mongo/test/org/immutables/mongo/fixture/criteria/PersonCriteriaTest.java