#vulnerable code 
                                @Test
    public void getStream_Marker() {
        final LoggerStream stream = logger.getStream(MarkerManager.getMarker("HI"), Level.INFO);
        stream.println("Hello, world!");
        stream.print("How about this?\n");
        stream.println("Is this thing on?");
        assertEquals(3, results.size());
        assertThat("Incorrect message.", results.get(0), startsWith("HI INFO Hello"));
        assertThat("Incorrect message.", results.get(1), startsWith("HI INFO How about"));
        assertThat("Incorrect message.", results.get(2), startsWith("HI INFO Is this"));
    } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void getStream_Marker() {
        final PrintWriter stream = logger.printWriter(MarkerManager.getMarker("HI"), Level.INFO);
        stream.println("println");
        stream.print("print with embedded newline\n");
        stream.println("last line");
        stream.close();
        assertEquals(3, results.size());
        assertEquals("println 1", "HI INFO println", results.get(0));
        assertEquals("print with embedded newline", "HI INFO print with embedded newline", results.get(1));
        assertEquals("println 2", "HI INFO last line", results.get(2));
    }