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