@Test
  void equality() {
    final Date date1 = new Date();
    final Date other = new Date(date1.getTime() + TimeUnit.DAYS.toMillis(1));
    repository.insert(generator.get().withId("id1").withValue(date1));

    ids(criteria.value.is(date1)).hasContentInAnyOrder("id1");
    ids(criteria.value.is(other)).isEmpty();
    ids(criteria.value.isNot(date1)).isEmpty();
    ids(criteria.value.isNot(other)).hasContentInAnyOrder("id1");
    ids(criteria.value.in(date1, date1)).hasContentInAnyOrder("id1");
    ids(criteria.value.notIn(date1, date1)).isEmpty();
    ids(criteria.value.notIn(new Date(other.getTime() + 20_000), new Date(other.getTime() + 20_000))).hasContentInAnyOrder("id1");

    final Date date2 = new Date(other.getTime() + 30_000);
    repository.insert(generator.get().withId("id2").withValue(date2));
    ids(criteria.value.is(date2)).hasContentInAnyOrder("id2");
    ids(criteria.value.isNot(date2)).hasContentInAnyOrder("id1");
    ids(criteria.value.isNot(date1)).hasContentInAnyOrder("id2");
    ids(criteria.value.in(date1, date2)).hasContentInAnyOrder("id1", "id2");
    ids(criteria.value.in(new Date(date2.getTime() + 10_000), new Date(date2.getTime() + 20_000))).isEmpty();
    ids(criteria.value.notIn(date1, date2)).isEmpty();
    ids(criteria.value.notIn(new Date(date2.getTime() + 10_000), date2)).hasContentInAnyOrder("id1");
    ids(criteria.value.notIn(date1, new Date(date2.getTime() + 10_000))).hasContentInAnyOrder("id2");
  }
Testing predicates, projections, sorting etc. on booleans
criteria/common/test/org/immutables/criteria/typemodel/DateTemplate.java