#vulnerable code 
                                @Test
    public void shouldBeAbleToOpenTxAfterPreviousIsClosed() throws Throwable
    {
        // Given
        Connection mock = mock( Connection.class );
        when( mock.isOpen() ).thenReturn( true );
        InternalSession sess = new InternalSession( mock );
        sess.beginTransaction().close();

        // When
        Transaction tx = sess.beginTransaction();

        // Then we should've gotten a transaction object back
        assertNotNull( tx );
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void shouldBeAbleToOpenTxAfterPreviousIsClosed() throws Throwable
    {
        // Given
        when( mock.isOpen() ).thenReturn( true );
        sess.beginTransaction().close();

        // When
        Transaction tx = sess.beginTransaction();

        // Then we should've gotten a transaction object back
        assertNotNull( tx );
    }