#vulnerable code 
                                @Test
    public void testSelectTransactedCount() {
        db() //
                .select("select name, score, name, score, name, score, name from person where name=?") //
                .parameters("FRED") //
                .transacted() //
                .count() //
                .test() //
                .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                .assertValueCount(1) //
                .assertComplete();
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testSelectTransactedCount() {
        try (Database db = db()) {
            db //
                    .select("select name, score, name, score, name, score, name from person where name=?") //
                    .parameters("FRED") //
                    .transacted() //
                    .count() //
                    .test() //
                    .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                    .assertValueCount(1) //
                    .assertComplete();
        }
    }