@SuppressWarnings("unchecked")
  @Test
  void optimization_getAll() {
    PersonRepository repository = createRepository(builder -> builder);
    repository.find(person.id.is("id1")).fetch();
    // expect some calls to be intercepted
    if (calls.isEmpty()) {
      Assertions.fail("Region.getAll(...) was not called. Check that this optimization is enabled");
    }
    check(calls).hasSize(1);
    check(calls.get(0).method.getName()).isIn("get", "getAll");
    check((Iterable<Object>) calls.get(0).args[0]).hasAll("id1");
    calls.clear();

    repository.find(person.id.in("id1", "id2")).fetch();
    check(calls).hasSize(1);
    check(calls.get(0).method.getName()).is("getAll");
    check((Iterable<Object>) calls.get(0).args[0]).hasAll("id1", "id2");
    calls.clear();

    // negatives should not use getAll
    repository.find(person.id.isNot("id1")).fetch();
    check(calls.isEmpty());

    repository.find(person.id.notIn("id1", "id2")).fetch();
    check(calls.isEmpty());

    // any other composite expression should not trigger getAll
    repository.find(person.id.is("id1").age.is(1)).fetch();
    repository.find(person.age.is(1).id.in(Arrays.asList("id1", "id2"))).fetch();
    check(calls.isEmpty());
  }
With ID resolver {@link Region#getAll(Collection)} should be called
criteria/geode/test/org/immutables/criteria/geode/GetAllOptimizationTest.java