#vulnerable code 
                                @Test
    public void taggingTest05() throws Exception {
        FileInputStream fis = new FileInputStream(sourceFolder + "iphone_user_guide.pdf");
        PdfReader reader = new PdfReader(fis);
        PdfDocument document = new PdfDocument(reader);

        Assert.assertEquals(2072, document.getNextStructParentIndex().intValue());

        document.close();
    } 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void taggingTest05() throws Exception {
        FileInputStream fis = new FileInputStream(sourceFolder + "iphone_user_guide.pdf");
        PdfReader reader = new PdfReader(fis);
        PdfDocument source = new PdfDocument(reader);

        PdfWriter writer = new PdfWriter(new FileOutputStream(destinationFolder + "taggingTest05.pdf"));
        PdfDocument destination = new PdfDocument(writer);
        destination.setTagged();

        source.copyPages(new TreeSet<Integer>() {{
            add(3);
            add(4);
            add(10);
            add(11);
        }}, destination).copyPages(50, 52, destination);


        destination.close();
        source.close();

        Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "taggingTest05.pdf", sourceFolder + "cmp_taggingTest05.pdf", destinationFolder, "diff_"));

    }