private void removeLastPageFromDocument() {
    if (documentOfPagesModel.getPagesAmount() > 0) {
      pagesCache.add(documentOfPagesModel.getLastPage());
      runCaretAndSelectionListeningTransparentCommand(
        () -> documentOfPagesModel.removeLastPage(dataProvider.getProject()));
    }
  }
private void removeLastPageFromDocument()