code: public List<StateId> pages(final int pageSize, final int totalResults) {
          Validate.isTrue(pageSize > 0, "Page size must be positive: was " + pageSize);
          Validate.isTrue(totalResults > 0, "Total results must be positive: was " + totalResults);
  
          final List<StateId> pages = new ArrayList<StateId>(totalResults / pageSize + 1);
  
          Range range = Range.first(pageSize);
  
          for ( ; range.getEnd() < totalResults - 1 ; range = range.next()) {
              pages.add(forRange(range));
          }
  
          // Though not strictly required, tidy up the last range to stop at the right upper bound
          pages.add(forRange(range.getStart(), totalResults - 1));
  
          return Collections.unmodifiableList(pages);
      }
docs: Convenience method for creating a list of {@code StateId}s suitable for paging through a stored state. Each
  {@code StateId} will have the same state token as {@code this} but with different index ranges. For example, with
  a page size of 200 and a total results of 420, the list will contain 3 entries with ranges of <tt>[0-199]</tt>,
  <tt>[200-399]</tt> and <tt>[400-419]</tt>.
  
  @param pageSize The size of each page
  @param totalResults The total number of results to generate pages for
  @return {@code StateId}s that can be used to page through a stored state