#vulnerable code 
                                @Test
    public void testFields() throws Exception
    {
        // GIVEN
        ResultBuilder builder = new ResultBuilder( "<unknown>", ParameterSupport.NO_PARAMETERS );
        builder.keys( new String[]{"k1"} );
        builder.record( new Value[]{value(42)} );
        Result result = builder.build();
        result.first();

        // WHEN
        List<Entry<Integer>> fields = Extract.fields( result, integerExtractor() );


        // THEN
        assertThat( fields, equalTo( Collections.singletonList( InternalEntry.of( "k1", 42 ) ) ) );
    } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testFields() throws Exception
    {
        // GIVEN
        ResultBuilder builder = new ResultBuilder( "<unknown>", ParameterSupport.NO_PARAMETERS );
        builder.keys( new String[]{"k1"} );
        builder.record( new Value[]{value(42)} );
        ResultCursor result = builder.build();
        result.first();

        // WHEN
        List<Entry<Integer>> fields = Extract.fields( result, integerExtractor() );


        // THEN
        assertThat( fields, equalTo( Collections.singletonList( InternalEntry.of( "k1", 42 ) ) ) );
    }