@Test
  public void notLogic() {
    Person john = new PersonGenerator().next().withId("john").withFullName("John").withAge(30);
    insert(john);

    check(person.not(p -> p.id.is("john"))).empty();
    check(person.not(p -> p.id.is("john").age.is(30))).empty();
    check(person.not(p -> p.id.is("john").age.is(31))).hasSize(1);
    check(person.not(p -> p.id.in("john", "john").age.in(30, 30))).empty();
    check(person.not(p -> p.id.in("john", "john").or().age.in(30, 30))).empty();
    check(person.not(p -> p.id.in("d", "d").age.in(99, 99))).hasSize(1);
    check(person.not(p -> p.id.in("d", "d").or().age.in(99, 99))).hasSize(1);

    check(person.not(p -> p.id.is("john1").or().id.is("john"))).empty();
    check(person.not(p -> p.id.is("john1").or().id.is("john2"))).hasSize(1);
    check(person.not(p -> p.id.isNot("john"))).hasSize(1);
    check(person.not(p -> p.age.atLeast(29).age.atMost(31))).empty();

    check(person.not(p -> p.age.is(30)).not(p2 -> p2.id.is("john"))).empty();
    check(person.not(p -> p.age.is(31)).not(p2 -> p2.id.is("DUMMY"))).hasSize(1);

    // double not
    check(person.not(p -> p.not(p2 -> p2.id.is("john")))).hasSize(1);

    // triple not
    check(person.not(p1 -> p1.not(p2 -> p2.not(p3 -> p3.id.is("john"))))).empty();
    check(person.not(p1 -> p1.not(p2 -> p2.not(p3 -> p3.id.isNot("john"))))).hasSize(1);

    check(person.not(p -> p.age.greaterThan(29))).empty();
    check(person.not(p -> p.age.greaterThan(31))).hasSize(1);

  }
some variations of boolean logic with {@code NOT} operator
criteria/common/test/org/immutables/criteria/personmodel/AbstractPersonTest.java