#vulnerable code 
                                @Test
    public void testAcquireBlocks2() throws Exception {
        VanillaMappedFile vmf = new VanillaMappedFile(
            newTempraryFile("vmf-acquire-blocks-2"),
            VanillaMappedMode.RW);

        final long nblocks = 50 * 100 * 1000;
        final VanillaMappedBlocks blocks = vmf.blocks(64);

        for(long i=0; i<nblocks; i++) {
            VanillaMappedBuffer b = blocks.acquire(i);
            assertEquals(1, b.refCount());

            b.release();

            assertEquals(0,b.refCount());
            assertTrue(b.unmapped());
        }

        vmf.close();
    } 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testAcquireBlocks2() throws Exception {
        VanillaMappedBlocks blocks = VanillaMappedBlocks.readWrite(
            newTempraryFile("vmf-acquire-blocks-2"),
            64);

        final long nblocks = 50 * 100 * 1000;
        for (long i = 0; i < nblocks; i++) {
            VanillaMappedBuffer b = blocks.acquire(i);
            assertEquals(1, b.refCount());

            b.release();

            assertEquals(0, b.refCount());
            assertTrue(b.unmapped());
        }

        blocks.close();
    }