code: @Override
    public int count() {
  
      int listSize = getList().size();
      int pageSize = getPageSize();
      int pageCount = listSize / pageSize;
  
      pageCount += listSize % pageSize > 0 ? 1 : 0;
  
      return pageCount;
    }
docs: Get the total number of {@link Page pages} in this {@link Pageable} object.
  
  @return an int value indicating the total number of {@link Page pages} in this {@link Pageable} object.