import static org.junit.Assert.*;
public class CodingRoomsUnitTests {
private final PrintStream standardOut = System.out;
private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();
System.setOut(new PrintStream(outputStreamCaptor));
System.setOut(standardOut);
public void testCase1() {
String input = "Joe\nMazzone";
InputStream in = new ByteArrayInputStream(input.getBytes());
assertTrue(outputStreamCaptor.toString().toLowerCase().trim().replace(" ", "").endsWith("Hello Joe Mazzone!".toLowerCase().trim().replace(" ", "")));
public void testCase2() {
String input = "Clark\nKent";
InputStream in = new ByteArrayInputStream(input.getBytes());
assertTrue(outputStreamCaptor.toString().toLowerCase().trim().replace(" ", "").endsWith("Hello Clark Kent!".toLowerCase().trim().replace(" ", "")));
public void testCase3() {
String input = "Bruce\nWayne";
InputStream in = new ByteArrayInputStream(input.getBytes());
assertTrue(outputStreamCaptor.toString().toLowerCase().trim().replace(" ", "").endsWith("Hello Bruce Wayne!".toLowerCase().trim().replace(" ", "")));