@Override
    public BucketSpec apply(final Grouping grouping) {
        return Values.builder()
                .field(grouping.requestedField().name())
                .type(Values.NAME)
                .limit(grouping.limit())
                .build();
    }
@Test
    void buildsBucketSpecCorrectly() {
        Grouping grouping = new Grouping("source", 3);
        final BucketSpec bucketSpec = toTest.apply(grouping);

        assertThat(bucketSpec)
                .isNotNull()
                .isInstanceOf(Values.class)
                .satisfies(b -> assertEquals(Collections.singletonList("source"), b.fields()))
                .satisfies(b -> assertEquals(Values.NAME, b.type()))
                .satisfies(b -> assertEquals(3, ((Values) b).limit()));
    }