@Override
    public MongoPaginationHelper<T> sort(Bson sort) {
        return new DefaultMongoPaginationHelper<>(collection, filter, sort, perPage, includeGrandTotal,
                grandTotalFilter, collation);
    }
@Test
    void testSort() {
        assertThat(paginationHelper.sort(ascending("_id")).page(1))
                .isEqualTo(paginationHelper.sort(ascending("_id")).page(1, alwaysTrue()))
                .isEqualTo(paginationHelper.sort(SortOrder.ASCENDING.toBsonSort("_id")).page(1))
                .isEqualTo(paginationHelper.sort(SortOrder.ASCENDING.toBsonSort("_id")).page(1, alwaysTrue()))
                .containsExactlyElementsOf(DTOs);

        assertThat(paginationHelper.sort(ascending("name")).page(1))
                .isEqualTo(paginationHelper.sort(ascending("name")).page(1, alwaysTrue()))
                .isEqualTo(paginationHelper.sort(SortOrder.ASCENDING.toBsonSort("name")).page(1))
                .isEqualTo(paginationHelper.sort(SortOrder.ASCENDING.toBsonSort("name")).page(1, alwaysTrue()))
                .containsExactlyElementsOf(DTOs);

        assertThat(paginationHelper.sort(descending("_id")).page(1))
                .isEqualTo(paginationHelper.sort(descending("_id")).page(1, alwaysTrue()))
                .isEqualTo(paginationHelper.sort(SortOrder.DESCENDING.toBsonSort("_id")).page(1))
                .isEqualTo(paginationHelper.sort(SortOrder.DESCENDING.toBsonSort("_id")).page(1, alwaysTrue()))
                .containsExactlyElementsOf(Lists.reverse(DTOs));

        assertThat(paginationHelper.sort(descending("name")).page(1))
                .isEqualTo(paginationHelper.sort(descending("name")).page(1, alwaysTrue()))
                .isEqualTo(paginationHelper.sort(SortOrder.DESCENDING.toBsonSort("name")).page(1))
                .isEqualTo(paginationHelper.sort(SortOrder.DESCENDING.toBsonSort("name")).page(1, alwaysTrue()))
                .containsExactlyElementsOf(Lists.reverse(DTOs));
    }