@@ -0,0 +1,954 @@
+import org.junit.Test;%0Aimport org.junit.Before;%0Aimport org.junit.After;%0Aimport static org.junit.Assert.*;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.PrintStream;%0A%0Apublic class StringFormattingTest %7B%0A%0A    private ByteArrayOutputStream out = new ByteArrayOutputStream();%0A%0A    private ByteArrayOutputStream err = new ByteArrayOutputStream();%0A%0A    @Before%0A    public void repalceSystemOutAndErr() %7B%0A        System.setOut(new PrintStream(out));%0A        System.setErr(new PrintStream(err));%0A    %7D%0A%0A    @After%0A    public void resetSystemOutAndErr() %7B%0A        System.setOut(null);%0A        System.setErr(null);%0A    %7D%0A%0A    @Test%0A    public void captureSystemOutput() %7B%0A        System.out.println(%22Output via System.out.println()%22);%0A        System.err.println(%22Output via System.err.println()%22);%0A        assertEquals(%22Output via System.out.println()%5Cn%22, out.toString());%0A        assertEquals(%22Output via System.err.println()%5Cn%22, err.toString());%0A    %7D%0A%0A%7D%0A

Add test fixture for capturing output through System.out.