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

    // select all
    check(repository.findAll().select(string.list).fetch())
            .hasContentInAnyOrder(Collections.emptyList(), Collections.singletonList("a2"), Arrays.asList("a3", "b3"));

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

    check(repository.find(string.id.is("id2")).select(string.list).one())
            .hasAll("a2");

    check(repository.find(string.id.is("id3")).select(string.list).one())
            .hasAll("a3", "b3");
  }
Projection on a list type (eg. {@code List<String>})
criteria/common/test/org/immutables/criteria/typemodel/StringTemplate.java