@Test
  protected void projectionOnIterable() {
    repository.insert(generator.get().withId("id1").withList()); // empty
    repository.insert(generator.get().withId("id2").withList(2)); // one element
    repository.insert(generator.get().withId("id3").withList(3, 4));

    // select all
    check(repository.findAll().select(criteria.list).fetch())
            .hasContentInAnyOrder(Collections.emptyList(), Collections.singletonList(2L), Arrays.asList(3L, 4L));

    // select by ID
    check(repository.find(criteria.id.is("id1")).select(criteria.list).one())
            .isEmpty();

    check(repository.find(criteria.id.is("id2")).select(criteria.list).one())
            .hasAll(2L);

    check(repository.find(criteria.id.is("id3")).select(criteria.list).one())
            .hasAll(3L, 4L);
  }
Projection on a list type (eg. {@code List<Long>})
criteria/common/test/org/immutables/criteria/typemodel/LongTemplate.java