#vulnerable code 
                                @Test
    public void testFullHeaderWithAfGcs() throws Exception {
        TestLogHandler handler = new TestLogHandler();
        handler.setLevel(Level.WARNING);
        IMP_LOGGER.addHandler(handler);
        DATA_READER_FACTORY_LOGGER.addHandler(handler);

        InputStream in = UnittestHelper.getResourceAsStream(UnittestHelper.FOLDER_IBM, "SampleIBMJ9_R27_SR1_full_header.txt");
        DataReader reader = new DataReaderIBM_J9_R28(in);
        GCModel model = reader.read();
        
        assertThat("model size", model.size(), is(3));

        GCEvent event = (GCEvent) model.get(0);
        assertThat("pause", event.getPause(), closeTo(0.042303, 0.0000001));

        assertThat("total before", event.getTotal(), is(toKiloBytes(1073741824)));
        assertThat("free before", event.getPreUsed(), is(toKiloBytes(1073741824 - 804158480)));
        assertThat("free after", event.getPostUsed(), is(toKiloBytes(1073741824 - 912835672)));

        assertThat("total young before", event.getYoung().getTotal(), is(toKiloBytes(268435456)));
        assertThat("young before", event.getYoung().getPreUsed(), is(toKiloBytes(268435456)));
        assertThat("young after", event.getYoung().getPostUsed(), is(toKiloBytes(268435456 - 108677192)));

        assertThat("total tenured before", event.getTenured().getTotal(), is(toKiloBytes(805306368)));
        assertThat("tenured before", event.getTenured().getPreUsed(), is(toKiloBytes(805306368 - 804158480)));
        assertThat("tenured after", event.getTenured().getPostUsed(), is(toKiloBytes(805306368 - 804158480)));

        assertThat("timestamp 1", event.getTimestamp(), closeTo(0.0, 0.0001));
        assertThat("timestamp 2", model.get(1).getTimestamp(), closeTo(1.927, 0.0001));
        assertThat("timestamp 3", model.get(2).getTimestamp(), closeTo(3.982, 0.0001));

        assertThat("number of errors", handler.getCount(), is(1));
    } 
                            #location 21 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void testFullHeaderWithAfGcs() throws Exception {
        TestLogHandler handler = new TestLogHandler();
        handler.setLevel(Level.WARNING);
        GCResource gcResource = new GCResource("SampleIBMJ9_R27_SR1_full_header.txt");
        gcResource.getLogger().addHandler(handler);

        DataReader reader = getDataReader(gcResource);
        GCModel model = reader.read();
        
        assertThat("model size", model.size(), is(3));

        GCEvent event = (GCEvent) model.get(0);
        assertThat("pause", event.getPause(), closeTo(0.042303, 0.0000001));

        assertThat("total before", event.getTotal(), is(toKiloBytes(1073741824)));
        assertThat("free before", event.getPreUsed(), is(toKiloBytes(1073741824 - 804158480)));
        assertThat("free after", event.getPostUsed(), is(toKiloBytes(1073741824 - 912835672)));

        assertThat("total young before", event.getYoung().getTotal(), is(toKiloBytes(268435456)));
        assertThat("young before", event.getYoung().getPreUsed(), is(toKiloBytes(268435456)));
        assertThat("young after", event.getYoung().getPostUsed(), is(toKiloBytes(268435456 - 108677192)));

        assertThat("total tenured before", event.getTenured().getTotal(), is(toKiloBytes(805306368)));
        assertThat("tenured before", event.getTenured().getPreUsed(), is(toKiloBytes(805306368 - 804158480)));
        assertThat("tenured after", event.getTenured().getPostUsed(), is(toKiloBytes(805306368 - 804158480)));

        assertThat("timestamp 1", event.getTimestamp(), closeTo(0.0, 0.0001));
        assertThat("timestamp 2", model.get(1).getTimestamp(), closeTo(1.927, 0.0001));
        assertThat("timestamp 3", model.get(2).getTimestamp(), closeTo(3.982, 0.0001));

        assertThat("number of errors", handler.getCount(), is(1));
    }