class ExtractPagesParameters extends MultiplePdfSourceMultipleOutputParameters implements PageRangeSelection,
        PagesSelection, OptimizableOutputTaskParameters, DiscardableOutlineTaskParameters {

    @Override
    public Set<Integer> getPages(int upperLimit) {
        Set<Integer> pages = new NullSafeSet<Integer>();
        if (predefinedSetOfPages != PredefinedSetOfPages.NONE) {
            pages = predefinedSetOfPages.getPages(upperLimit);
        } else {
            for (PageRange range : pageSelection) {
                pages.addAll(range.getPages(upperLimit));
            }
        }

        if (!invertSelection) {
            return pages;
        }

        Set<Integer> invertedPages = new NullSafeSet<Integer>();
        for (int i = 1; i <= upperLimit; i++) {
            if (!pages.contains(i)) {
                invertedPages.add(i);
            }
        }

        return invertedPages;
    }

    public  ExtractPagesParameters();
    public  ExtractPagesParameters(PredefinedSetOfPages predefinedSetOfPages);

}