@Test
  void projection() {
    repository.insert(generator.get().withId("id1").withValue(1).withNullable(null).withBoxed(1L)
            .withOptional(OptionalLong.empty()).withOptional2(Optional.of(1L)));

    repository.insert(generator.get().withId("id2").withValue(2).withNullable(2L).withBoxed(2L).withOptional(OptionalLong.of(2))
            .withOptional2(Optional.empty()));

    // projection of one attribute
    check(repository.findAll().select(criteria.id).fetch()).hasContentInAnyOrder("id1", "id2");
    check(repository.findAll().select(criteria.value).fetch()).hasContentInAnyOrder(1L, 2L);
    check(repository.findAll().select(criteria.nullable).asOptional().fetch()).hasContentInAnyOrder(Optional.empty(), Optional.of(2L));
    check(repository.findAll().select(criteria.boxed).fetch()).hasContentInAnyOrder(1L, 2L);
    check(repository.findAll().select(criteria.optional).fetch()).hasContentInAnyOrder(OptionalLong.empty(), OptionalLong.of(2));
    check(repository.findAll().select(criteria.optional2).fetch()).hasContentInAnyOrder(Optional.of(1L), Optional.empty());
  }
Testing various string operations prefix/suffix/length etc.
criteria/common/test/org/immutables/criteria/typemodel/LongTemplate.java