'Spring Data PagedListHolder second page is show the same data as first page when the page size is greater than or equal the data size

I've the actual data = 25 records and then I sent the request

Page : 1 PageSize : 25

The data return with 25 records correctly but when I try

Page : 2 PageSize : 25

The data return with 25 records same way as Page 1 why the data is not ending on the first page ?
Could you please help me to fix this with any input ?
How can I get correct data on the page for any input?
Here is my code :

PagedListHolder<ObjectResponseDTO> pagedListHolder = new PagedListHolder<>(ObjectResponse);
pagedListHolder.setPage(Request.getPageDesc().getCurrentPage() - 1);
pagedListHolder.setPageSize(Request.getPageDesc().getPageSize());


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source