@Test
  void booleanLogic() {
    repository.insert(generator.get().withId("id").withValue("value").withNullable("nullable").withOptional(Optional.of("optional")));

    // values are same as attribute names so boolean logic is easier to follow
    // value == 'value' or id == 'id' (true)
    // nullable == 'no' (false)

    // true and (false or false) == false
    logicalFalse(string.value.is("value").and(string.nullable.is("no").or().id.is("no")));

    // true and (false or true) == true
    logicalTrue(string.value.is("value").and(string.nullable.is("no").or().id.is("id")));

    // false and (true or true) == false
    logicalFalse(string.value.is("no").and(string.nullable.is("nullable").or().id.is("id")));

    // false or (true and true) == true
    logicalTrue(string.value.is("no").or(string.nullable.is("nullable").id.is("id")));

    // false or (true and false) == false
    logicalFalse(string.value.is("no").or(string.nullable.is("nullable").id.is("no")));

    // (false or true) and false == false
    logicalFalse(string.value.is("no").or().nullable.is("nullable").and(string.id.is("no")));

    // false or true or false == true
    logicalTrue(string.value.is("no").or().nullable.is("nullable").or().id.is("no"));

    // false or false or false == false
    logicalFalse(string.value.is("no").or().nullable.is("no").or().id.is("no"));

    // false and false or true == true
    logicalTrue(string.value.is("no").nullable.is("no").or().id.is("id"));
  }
Test things like {@code A and (B or C)}, {@code A or B and C} {@code A or (not B and C)} etc.
Make sure boolean conditions are correctly grouped (in terms of expression priority).
criteria/common/test/org/immutables/criteria/typemodel/BooleanLogicTemplate.java