#vulnerable code 
                                @Test
    public void getStream() {
        final LoggerStream stream = logger.getStream(Level.DEBUG);
        stream.println("Debug message 1");
        stream.print("Debug message 2");
        stream.println();
        stream.println(); // verify blank log message
        stream.print("Debug message 3\n");
        stream.print("\r\n"); // verify windows EOL works
        assertEquals(5, results.size());
        assertThat("Incorrect message", results.get(0), startsWith(" DEBUG Debug message 1"));
        assertThat("Incorrect message", results.get(1), startsWith(" DEBUG Debug message 2"));
        assertEquals("Message should be blank-ish", " DEBUG ", results.get(2));
        assertThat("Incorrect message", results.get(3), startsWith(" DEBUG Debug message 3"));
        assertEquals("Message should be blank-ish", " DEBUG ", results.get(4));
    } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void getStream() {
        final PrintWriter stream = logger.printWriter(Level.DEBUG);
        stream.println("println");
        stream.print("print followed by println");
        stream.println();
        stream.println("multiple\nlines");
        stream.println(); // verify blank log message
        stream.print("print embedded newline\n");
        stream.print("\r\n"); // verify windows EOL works
        stream.print("Last Line without newline");
        stream.close();
        assertEquals(8, results.size());
        assertEquals("msg 1", " DEBUG println", results.get(0));
        assertEquals("msg 2", " DEBUG print followed by println", results.get(1));
        assertEquals("msg 3", " DEBUG multiple", results.get(2));
        assertEquals("msg 4", " DEBUG lines", results.get(3));
        assertEquals("msg 5 should be blank-ish", " DEBUG ", results.get(4));
        assertEquals("msg 6", " DEBUG print embedded newline", results.get(5));
        assertEquals("msg 7 should be blank-ish", " DEBUG ", results.get(6));
        assertEquals("msg 8 Last line", " DEBUG Last Line without newline", results.get(7));
    }