@Override
    public ListResult<String> retrieve(GroupVersionKind type, ListOptions options,
        PageRequest page) {
        var allMatchedResult = doRetrieve(type, options, page.getSort());
        var list = ListResult.subList(allMatchedResult, page.getPageNumber(), page.getPageSize());
        return new ListResult<>(page.getPageNumber(), page.getPageSize(),
            allMatchedResult.size(), list);
    }
@Test
    void retrieve() {
        var spyIndexedQueryEngine = spy(indexedQueryEngine);
        doReturn(List.of("object1", "object2", "object3")).when(spyIndexedQueryEngine)
            .doRetrieve(any(), any(), eq(Sort.unsorted()));

        var gvk = GroupVersionKind.fromExtension(DemoExtension.class);

        var pageRequest = mock(PageRequest.class);
        when(pageRequest.getPageNumber()).thenReturn(1);
        when(pageRequest.getPageSize()).thenReturn(2);
        when(pageRequest.getSort()).thenReturn(Sort.unsorted());

        var result = spyIndexedQueryEngine.retrieve(gvk, new ListOptions(), pageRequest);
        assertThat(result.getItems()).containsExactly("object1", "object2");
        assertThat(result.getTotal()).isEqualTo(3);

        verify(spyIndexedQueryEngine).doRetrieve(eq(gvk), any(), eq(Sort.unsorted()));
        verify(pageRequest, times(2)).getPageNumber();
        verify(pageRequest, times(2)).getPageSize();
        verify(pageRequest).getSort();
    }