#fixed code
                                @Test
    public void testFlush() throws IOException {
        final OutputStream out = EasyMock.createMock(OutputStream.class);
        out.flush(); // expect the flush to come through to the mocked OutputStream
        out.close();
        replay(out);

        try (final OutputStream filteredOut =
            IoBuilder.forLogger(getExtendedLogger())
                .filter(out)
                .setLevel(LEVEL)
                .buildOutputStream()) {
        	filteredOut.flush();
        }
        verify(out);
    }
#vulnerable code 
                                @Test
    public void testFlush() throws IOException {
        final OutputStream out = EasyMock.createMock(OutputStream.class);
        out.flush(); // expect the flush to come through to the mocked OutputStream
        out.close();
        replay(out);

        final OutputStream filteredOut =
            IoBuilder.forLogger(getExtendedLogger())
                .filter(out)
                .setLevel(LEVEL)
                .buildOutputStream();
        filteredOut.flush();
        filteredOut.close();
        verify(out);
    } 
                            #location 16 
                            #vulnerability type RESOURCE_LEAK