@Test
  void distinct2() {
    ImmutableQuery query = Query.of(Person.class)
            .addProjections(Matchers.toExpression(person.nickName))
            .addProjections(Matchers.toExpression(person.age))
            .withDistinct(true);

    assertAgg(query, "{$project: {expr0: '$nickName', expr1: '$age'}}",
            "{$group: {_id: {expr0: '$expr0', expr1: '$expr1'}}}",
            "{$project: {expr0: '$_id.expr0', expr1: '$_id.expr1'}}");

    assertAgg(query.withLimit(1), "{$project: {expr0: '$nickName', expr1: '$age'}}",
            "{$group: {_id: {expr0: '$expr0', expr1: '$expr1'}}}",
            "{$project: {expr0: '$_id.expr0', expr1: '$_id.expr1'}}",
            "{$limit: 1}");

    assertAgg(query.withLimit(1).withCount(true), "{$project: {expr0: '$nickName', expr1: '$age'}}",
            "{$group: {_id: {expr0: '$expr0', expr1: '$expr1'}}}",
            "{$project: {expr0: '$_id.expr0', expr1: '$_id.expr1'}}",
            "{$limit: 1}",
            "{$count: 'count'}"
    );
  }
Testing two field (s): {@code select distinct a, b from ...}
criteria/mongo/test/org/immutables/criteria/mongo/AggregationQueryTest.java