### Question:
PageRequest implements Pageable { public void adjustPageNumber(int totalCount) { int maxPageNumber = getPageNumber(totalCount - 1); if (pageNumber > maxPageNumber) { pageNumber = maxPageNumber; } } PageRequest(String requestedPageNumber, int pageSize);  PageRequest(int pageNumber, int pageSize); @Override int getPageNumber(); @Override int getPageSize(); @Override int getOffset(); @Override Sort getSort(); void adjustPageNumber(int totalCount); static PageRequest fetchFromPage(Page page); static final int FIRST_PAGE_NUMBER; static final int MAX_PAGE; }### Answer:
@Test public void testAdjustPageNumber() { pageRequest = new PageRequest(PAGE_NUMBER, PAGE_SIZE_10); pageRequest.adjustPageNumber(TOTAL_COUNT_50); int actualPageNumber = pageRequest.getPageNumber(); int expectedPageNumber = Integer.parseInt(PAGE_NUMBER); assertEquals(actualPageNumber, expectedPageNumber); }