@Test
  void basicExists() {
    check(!repository.findAll().exists());

    repository.insert(generator.get().withId("id1").withValue("v1"));
    check(repository.findAll().exists());

    check(repository.find(string.id.is("id1")).exists());
    check(!repository.find(string.id.is("idBAD")).exists());
    check(repository.find(string.id.isNot("idBAD")).exists());
    check(!repository.find(string.id.isNot("id1")).exists());

    check(repository.find(string.value.is("v1")).exists());
    check(!repository.find(string.value.is("v2")).exists());
    check(!repository.find(string.value.isNot("v1")).exists());
    check(repository.find(string.value.isNot("v2")).exists());

    repository.insert(generator.get().withId("id2").withValue("v2").withOptional("o2"));
    check(repository.findAll().exists());
    check(repository.find(string.id.is("id2")).exists());
    check(repository.find(string.id.in("id1", "id2")).exists());
    check(!repository.find(string.id.notIn("id1", "id2")).exists());

    repository.insert(generator.get().withValue("v3"));
    check(repository.findAll().exists());

    check(!repository.find(string.id.is("BAD")).exists());
    check(!repository.find(string.value.is("BAD")).exists());
    check(!repository.find(string.value.in("BAD1", "BAD2")).exists());
    check(repository.find(string.value.is("v1")).exists());
    check(repository.find(string.value.in("v1", "v2")).exists());
    check(repository.find(string.value.in("v1", "BAD")).exists());
    check(repository.find(string.value.in("BAD", "v1")).exists());
    check(repository.find(string.value.in("v1", "v2", "v3")).exists());

    // with projections. not very common but still possible
    check(repository.find(string.value.in("v1", "v2", "v3")).select(string.value).exists());
    check(repository.find(string.value.in("v1", "v2", "v3"))
            .select(string.value, string.value).map((a, b) -> "a").exists());
    check(repository.find(string.value.in("v1", "v2", "v3"))
            .select(string.value, string.value).map(tuple -> tuple.get(string.value)).exists());
    check(repository.find(string.value.in("v1", "v2", "v3"))
            .select(string.value, string.value, string.value).map((a, b, c) -> "a").exists());
  }
Testing {@code exists} functionality, ie wherever at least one record could be found
for a given criteria.
criteria/common/test/org/immutables/criteria/typemodel/ExistsTemplate.java