package com.twu.biblioteca;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;


public class OutputHandlerTest {
    private ByteArrayOutputStream byteArrayOutputStream;

    @Before
    public void setUp() {
        byteArrayOutputStream = new ByteArrayOutputStream();
        System.setOut(new PrintStream(byteArrayOutputStream));
    }

    @Test
    public void shouldBeAbleToDisplayWelcomeMessage() {
        OutputHandler outputHandler = new OutputHandler();
        outputHandler.welcomeMessage();

        String actualMessage = byteArrayOutputStream.toString();

        assertThat(actualMessage, is(equalTo("Welcome to Biblioteca\n")));
    }

    @After
    public void tearDown() throws Exception {
        System.setOut(null);
    }
}
@@ -389,16 +389,57 @@
 tStream;
+%0A    private OutputHandler outputHandler;
 %0A%0A    @B
@@ -590,24 +590,69 @@
 utStream));%0A
+        outputHandler = new OutputHandler();%0A
     %7D%0A%0A    @
@@ -716,67 +716,8 @@
 ) %7B%0A
-        OutputHandler outputHandler = new OutputHandler();%0A
     

Refactor - moved object instatiation in to setUp in OutputHandlerTest