#fixed code
                                @Test
    public void Sample1 () throws IOException, COSVisitorException {

        //Set margins
        float margin = 10;

        
        List<String[]> facts = getFacts();

        //Initialize Document
        PDDocument doc = new PDDocument();
        PDPage page = addNewPage(doc);
        float yStartNewPage = page.findMediaBox().getHeight() - (2 * margin);
        
        //Initialize table
        float tableWidth = page.findMediaBox().getWidth() - (2 * margin);
        boolean drawContent = false;
        float yStart = yStartNewPage;
        float bottomMargin = 70;
        BaseTable table  = new BaseTable(yStart,yStartNewPage, bottomMargin, tableWidth, margin, doc, page, true, drawContent);

        //Create Header row
        Row headerRow = table.createRow(15f);
        Cell cell = headerRow.createCell(100, "Awesome Facts About Belgium");
        cell.setFont(PDType1Font.HELVETICA_BOLD);
        cell.setFillColor(Color.BLACK);
        cell.setTextColor(Color.WHITE);
        

        table.setHeader(headerRow);

        //Create 2 column row
        Row row = table.createRow(15f);
        cell = row.createCell(30,"Source:");
        cell.setFont(PDType1Font.HELVETICA);
        
        cell = row.createCell(70, "http://www.factsofbelgium.com/");
        cell.setFont(PDType1Font.HELVETICA_OBLIQUE);

        //Create Fact header row
        Row factHeaderrow = table.createRow(15f);
        
        cell = factHeaderrow.createCell((100 / 3) * 2, "Fact");
        cell.setFont(PDType1Font.HELVETICA);
        cell.setFontSize(6);
        cell.setFillColor(Color.LIGHT_GRAY);
        
        cell = factHeaderrow.createCell((100 / 3), "Tags");
        cell.setFillColor(Color.LIGHT_GRAY);
        cell.setFont(PDType1Font.HELVETICA_OBLIQUE);
        cell.setFontSize(6);

        //Add multiple rows with random facts about Belgium
        for (String[] fact : facts) {

            row = table.createRow(10f);
            cell = row.createCell((100 / 3) * 2, fact[0]);
            cell.setFont(PDType1Font.HELVETICA);
            cell.setFontSize(6);

            for (int i = 1; i < fact.length; i++) {

                cell = row.createCell((100 / 9), fact[i]);
                cell.setFont(PDType1Font.HELVETICA_OBLIQUE);
                cell.setFontSize(6);
                //Set colors
                if (fact[i].contains("beer")) cell.setFillColor(Color.yellow);
                if (fact[i].contains("champion")) cell.setTextColor(Color.GREEN);
            }
        }

        table.draw();

        //Close Stream and save pdf
        File file = new File("target/BoxableSample1.pdf");
        Files.createParentDirs(file);
        doc.save(file);
        doc.close();

    }
#vulnerable code 
                                @Test
    public void Sample1 () throws IOException, COSVisitorException {

        //Set margins
        float margin = 10;

        
        List<String[]> facts = getFacts();

        //Initialize Document
        PDDocument doc = new PDDocument();
        PDPage page = addNewPage(doc);
        float top = page.findMediaBox().getHeight() - (2 * margin);
        
        //Initialize table
        float tableWidth = page.findMediaBox().getWidth() - (2 * margin);
        boolean drawContent = false;
        Table table  = new Table(top,tableWidth, margin, doc, page, true, drawContent);

        //Create Header row
        Row headerRow = table.createRow(15f);
        Cell cell = headerRow.createCell(100, "Awesome Facts About Belgium");
        cell.setFont(PDType1Font.HELVETICA_BOLD);
        cell.setFillColor(Color.BLACK);
        cell.setTextColor(Color.WHITE);
        

        table.setHeader(headerRow);

        //Create 2 column row
        Row row = table.createRow(15f);
        cell = row.createCell(30,"Source:");
        cell.setFont(PDType1Font.HELVETICA);
        
        cell = row.createCell(70, "http://www.factsofbelgium.com/");
        cell.setFont(PDType1Font.HELVETICA_OBLIQUE);

        //Create Fact header row
        Row factHeaderrow = table.createRow(15f);
        
        cell = factHeaderrow.createCell((100 / 3) * 2, "Fact");
        cell.setFont(PDType1Font.HELVETICA);
        cell.setFontSize(6);
        cell.setFillColor(Color.LIGHT_GRAY);
        
        cell = factHeaderrow.createCell((100 / 3), "Tags");
        cell.setFillColor(Color.LIGHT_GRAY);
        cell.setFont(PDType1Font.HELVETICA_OBLIQUE);
        cell.setFontSize(6);

        //Add multiple rows with random facts about Belgium
        for (String[] fact : facts) {

            row = table.createRow(10f);
            cell = row.createCell((100 / 3) * 2, fact[0]);
            cell.setFont(PDType1Font.HELVETICA);
            cell.setFontSize(6);

            for (int i = 1; i < fact.length; i++) {

                cell = row.createCell((100 / 9), fact[i]);
                cell.setFont(PDType1Font.HELVETICA_OBLIQUE);
                cell.setFontSize(6);
                //Set colors
                if (fact[i].contains("beer")) cell.setFillColor(Color.yellow);
                if (fact[i].contains("champion")) cell.setTextColor(Color.GREEN);
            }
        }

        table.draw();

        //Close Stream and save pdf
        File file = new File("target/BoxableSample1.pdf");
        Files.createParentDirs(file);
        doc.save(file);
        doc.close();

    } 
                            #location 67 
                            #vulnerability type RESOURCE_LEAK