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

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

    @Option(names = {"-o", "--output"}, description = "the PDF file to save to. If omitted the original file will be used")
    private File outfile;

    @Option(names = {"--data"}, description = "the XFDF data file to import from", required = true)
    private File xfdffile;

    /**
     * This will takes the values from the fdf document and import them into the
     * PDF document.
     *
     * @param pdfDocument The document to put the fdf data into.
     * @param fdfDocument The FDF document to get the data from.
     *
     * @throws IOException If there is an error setting the data in the field.
     */
    public void importFDF( PDDocument pdfDocument, FDFDocument fdfDocument ) throws IOException
    {
        PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog();
        PDAcroForm acroForm = docCatalog.getAcroForm();
        acroForm.setCacheFields( true );
        acroForm.importFDF( fdfDocument );
    }

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

    /**
     * This will import an fdf document and write out another pdf. <br>
     * see usage() for commandline
     *
     * @param args command line arguments
     */
    public static void main(String[] args)
    {
        // suppress the Dock icon on OS X
        System.setProperty("apple.awt.UIElement", "true");

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

    public Integer call()
    {<FILL_FUNCTION_BODY>}
}

        ImportXFDF importer = new ImportXFDF();
        try (PDDocument pdf = Loader.loadPDF(infile);
                FDFDocument fdf = Loader.loadXFDF(xfdffile))
        {
            importer.importFDF( pdf, fdf );

            if (outfile == null)
            {
                outfile = infile;
            }

            pdf.save(outfile);
        }
        catch (IOException ioe)
        {
            SYSERR.println( "Error importing XFDF data [" + ioe.getClass().getSimpleName() + "]: " + ioe.getMessage());
            return 4;
        }
        return 0;
    
<no_super_class>