#vulnerable code 
                                @Test
    public void authDisabled() throws IOException, UserException {
        try (Socket socket = new Socket(hostAddress, port)) {
            assertThat(socket.isConnected()).isTrue();
            PrintStream printStream = new PrintStream(socket.getOutputStream());
            final BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));

            greenMail.getManagers().getUserManager().setAuthRequired(false);

            assertThat(reader.readLine()).startsWith("+OK POP3 GreenMail Server v");
            printStream.print("USER blar@blar.com" + CRLF);
            assertThat(reader.readLine()).isEqualTo("+OK");
        }
    } 
                            #location 11 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void authDisabled() throws IOException {
        greenMail.getManagers().getUserManager().setAuthRequired(false);
        withConnection((printStream, reader) -> {
            assertThat(reader.readLine()).startsWith("+OK POP3 GreenMail Server v");
            printStream.print("USER blar@blar.com" + CRLF);
            assertThat(reader.readLine()).isEqualTo("+OK");
        });
    }