void (long pagesAmount) { if (targetCaretPosition.pageNumber < 0) { targetCaretPosition.set(0, 0); } else if (targetCaretPosition.pageNumber >= pagesAmount) { targetCaretPosition.set(pagesAmount, 0); } }