@Test
  public void projection_ofContainers() {
    assumeFeature(Feature.QUERY_WITH_PROJECTION);
    final PersonGenerator generator = new PersonGenerator();
    insert(generator.next().withFullName("John").withNickName(Optional.empty()).withInterests("one").withIsActive(true));
    insert(generator.next().withFullName("Mary").withNickName("a").withInterests("one", "two", "three").withIsActive(false));
    insert(generator.next().withFullName("Emma").withNickName("b").withInterests("four").withIsActive(true));

    // nickname
    Checkers.check(repository().findAll().select(person.nickName).fetch()).hasContentInAnyOrder(Optional.empty(), Optional.of("a"), Optional.of("b"));
    Checkers.check(repository().findAll().select(person.fullName, person.nickName).map((k, v) -> k + "-" + v.orElse("")).fetch())
            .hasContentInAnyOrder("John-", "Mary-a", "Emma-b");

    Checkers.check(repository().findAll().select(person.address).fetch()).notEmpty();
    Checkers.check(repository().findAll().select(person.bestFriend).fetch()).notEmpty();
  }
Projection of fields which have container-like attributes: {@code Optional<T>}, {@code List<T>} etc.
criteria/common/test/org/immutables/criteria/personmodel/AbstractPersonTest.java