#vulnerable code 
                              public void testReadLookahead2() throws Exception {
    char[] ref = new char[5];
    char[] res = new char[5];  
    
    br = getEBR("");
    assertEquals(0, br.read(res, 0, 0));
    assertTrue(Arrays.equals(res, ref)); 
    
    br = getEBR("abcdefg");
    ref[0] = 'a';
    ref[1] = 'b';
    ref[2] = 'c';
    assertEquals(3, br.read(res, 0, 3));
    assertTrue(Arrays.equals(res, ref));
    assertEquals('c', br.readAgain());
    
    assertEquals('d', br.lookAhead());
    ref[4] = 'd';
    assertEquals(1, br.read(res, 4, 1));
    assertTrue(Arrays.equals(res, ref));
    assertEquals('d', br.readAgain());
 
  } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              public void testReadLookahead2() throws Exception {
    char[] ref = new char[5];
    char[] res = new char[5];  
    
    ExtendedBufferedReader br = getEBR("");
    assertEquals(0, br.read(res, 0, 0));
    assertTrue(Arrays.equals(res, ref)); 
    
    br = getEBR("abcdefg");
    ref[0] = 'a';
    ref[1] = 'b';
    ref[2] = 'c';
    assertEquals(3, br.read(res, 0, 3));
    assertTrue(Arrays.equals(res, ref));
    assertEquals('c', br.readAgain());
    
    assertEquals('d', br.lookAhead());
    ref[4] = 'd';
    assertEquals(1, br.read(res, 4, 1));
    assertTrue(Arrays.equals(res, ref));
    assertEquals('d', br.readAgain());
 
  }