boolean (long curPageNumber, long pagesAmount, SearchTaskOptions options) { return curPageNumber < 0 || curPageNumber >= pagesAmount || options.rightBoundPageNumber != -1 && curPageNumber > options.rightBoundPageNumber || options.leftBoundPageNumber != -1 && curPageNumber < options.leftBoundPageNumber; }