#vulnerable code 
                                @Test(expected = IllegalArgumentException.class)
    public void testReturnGeneratedKeysWithBatchSizeShouldThrow() {
        Database db = db();
        // note is a table with auto increment
        db.update("insert into note(text) values(?)") //
                .parameters("HI", "THERE") //
                .batchSize(2) //
                .returnGeneratedKeys();
    } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test(expected = IllegalArgumentException.class)
    public void testReturnGeneratedKeysWithBatchSizeShouldThrow() {
        try (Database db = db()) {
            // note is a table with auto increment
            db.update("insert into note(text) values(?)") //
                    .parameters("HI", "THERE") //
                    .batchSize(2) //
                    .returnGeneratedKeys();
        }
    }