class PagerImpl implements Pager {

    @Nonnull
    @Override
    public List<PagerPage> getPages() {

        List<PagerPage> pages = new ArrayList<>();

        for (int currentIndex = 1; currentIndex <= totalPages; currentIndex++) {
            Map<String, String> pageParameters = new HashMap<>(existingQueryParameters);
            pageParameters.put("page", Integer.toString(currentIndex));
            if (inDisplayRange(totalPages, currentIndex) || currentIndex == 1 || currentIndex == totalPages) {
                pages.add(new PagerPageImpl(currentIndex, pageParameters, true));
            }
        }

        return pages;
    }

    public  PagerImpl(final Map<String, String> existingQueryParameters, final int totalPages, final int currentPageIndex);

}