@Override
  public Page getPage_wait(long pageNumber) throws IOException {
    myLock.lock();
    try {
      String notUpdatedPageText;

      long pagesAmount = fileAdapter.getPagesAmount();
      boolean neededPageShouldBeLastInFile = (pageNumber == pagesAmount - 1);

      Page notUpdatedPage = null;
      for (Iterator<Page> iterator = notUpdatedPagesCash.iterator(); iterator.hasNext(); ) {
        Page pageFromCash = iterator.next();
        if (pageFromCash.getPageNumber() == pageNumber) {
          boolean isOutdated = pageFromCash.isLastInFile() != neededPageShouldBeLastInFile;
          if (isOutdated) {
            iterator.remove();
          }
          else {
            notUpdatedPage = pageFromCash;
            break;
          }
        }
      }

      if (notUpdatedPage != null) {
        notUpdatedPageText = notUpdatedPage.getText();
      }
      else {
        notUpdatedPageText = fileAdapter.getPageText(pageNumber);
        if (notUpdatedPageText == null) {
          return null;
        }
        notUpdatedPage = new Page(notUpdatedPageText, pageNumber, neededPageShouldBeLastInFile);
        notUpdatedPagesCash.add(notUpdatedPage);
      }

      // TODO: 2019-05-14 Temporary solution for problem: soft-wrapping restricted for document, where isAcceptSlashR flag is TRUE. See SoftWrapModelImpl#areSoftWrapsEnabledInEditor()
      String notUpdatedPageTextWithoutSlashR = destroySlashRSeparators(notUpdatedPageText);

      return new Page(notUpdatedPageTextWithoutSlashR, pageNumber, neededPageShouldBeLastInFile);
    }
    finally {
      myLock.unlock();
    }
  }
@Override
  public Page getPage_wait(long pageNumber)