class PDFSplit implements Callable<Integer>
{
    // Expected for CLI app to write to System.out/System.err
    @SuppressWarnings("squid:S106")
    private final PrintStream SYSERR;

    @Option(names = "-password", description = "the password to decrypt the document.", arity = "0..1", interactive = true)    
    private String password;

    @Option(names = "-split", description = "split after this many pages (default 1, if startPage and endPage are unset).")    
    private int split = -1;

    @Option(names = "-startPage", description = "start page.")    
    private int startPage = -1;

    @Option(names = "-endPage", description = "end page.")    
    private int endPage = -1;

    @Option(names = "-outputPrefix", description = "the filename prefix for split files.")    
    private String outputPrefix;

    @Option(names = {"-i", "--input"}, description = "the PDF file to split", required = true)
    private File infile;

    /**
     * Constructor.
     */
    public PDFSplit()
    {
        SYSERR = System.err;
    }

    /**
     * Infamous main method.
     *
     * @param args Command line arguments, should be one and a reference to a file.
     */
    public static void main( String[] args )
    {
        // suppress the Dock icon on OS X
        System.setProperty("apple.awt.UIElement", "true");

        int exitCode = new CommandLine(new PDFSplit()).execute(args);
        System.exit(exitCode);
    }

    public Integer call()
    {<FILL_FUNCTION_BODY>}
}

        Splitter splitter = new Splitter();

        if (outputPrefix == null)
        {
            outputPrefix = FilenameUtils.removeExtension(infile.getAbsolutePath());
        }

        List<PDDocument> documents = null;

        try (PDDocument document = Loader.loadPDF(infile, password))
        {
            boolean startEndPageSet = false;
            if (startPage != -1)
            {
                splitter.setStartPage(startPage);
                startEndPageSet = true;
                if (split == -1)
                {
                    int numberOfPages = document.getNumberOfPages();
                    splitter.setSplitAtPage(numberOfPages);
                }
            }
            if (endPage != -1)
            {
                splitter.setEndPage(endPage);
                startEndPageSet = true;
                if (split == -1)
                {
                    splitter.setSplitAtPage(endPage);
                }
            }
            if (split != -1)
            {
                splitter.setSplitAtPage(split);
            }
            else 
            {
                if (!startEndPageSet)
                {
                    splitter.setSplitAtPage(1);
                }
            }
                
            documents = splitter.split( document );
            for( int i=0; i<documents.size(); i++ )
            {
                try (PDDocument doc = documents.get(i))
                {
                    doc.save(outputPrefix + "-" + (i + 1) + ".pdf");
                }
            }
        }
        catch (IOException ioe)
        {
            SYSERR.println( "Error splitting document [" + ioe.getClass().getSimpleName() + "]: " + ioe.getMessage());
            return 4;
        }
        finally
        {
            if (documents != null)
            {
                documents.forEach(IOUtils::closeQuietly);
            }
        }
        return 0;
    
<no_super_class>