#vulnerable code 
                                @Test
    public void testReadLookahead2() throws Exception {
        final char[] ref = new char[5];
        final char[] res = new char[5];

        final ExtendedBufferedReader br = getBufferedReader("abcdefg");
        ref[0] = 'a';
        ref[1] = 'b';
        ref[2] = 'c';
        assertEquals(3, br.read(res, 0, 3));
        assertArrayEquals(ref, res);
        assertEquals('c', br.getLastChar());

        assertEquals('d', br.lookAhead());
        ref[4] = 'd';
        assertEquals(1, br.read(res, 4, 1));
        assertArrayEquals(ref, res);
        assertEquals('d', br.getLastChar());
    } 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testReadLookahead2() throws Exception {
        final char[] ref = new char[5];
        final char[] res = new char[5];

        final ExtendedBufferedReader br = getBufferedReader("abcdefg");
        ref[0] = 'a';
        ref[1] = 'b';
        ref[2] = 'c';
        assertEquals(3, br.read(res, 0, 3));
        assertArrayEquals(ref, res);
        assertEquals('c', br.getLastChar());

        assertEquals('d', br.lookAhead());
        ref[4] = 'd';
        assertEquals(1, br.read(res, 4, 1));
        assertArrayEquals(ref, res);
        assertEquals('d', br.getLastChar());
        br.close();
    }