package org.gradle.sample.integtest.app;

import org.junit.jupiter.api.Test;

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

import org.gradle.sample.app.Main;

import static org.junit.jupiter.api.Assertions.assertEquals;


public class MainIntegrationTest {
    @Test
    public void testMain() {
        PrintStream savedOut = System.out;
        try {
            ByteArrayOutputStream outStreamForTesting = new ByteArrayOutputStream();
            System.setOut(new PrintStream(outStreamForTesting));

            Main.main(new String[0]);

            assertEquals("Hello, World!\n", outStreamForTesting.toString());
        } finally {
            System.setOut(savedOut);
        }
    }
}

@@ -136,16 +136,73 @@
 tStream;
+%0Aimport java.io.PrintWriter;%0Aimport java.io.StringWriter;
 %0A%0Aimport
@@ -631,38 +631,200 @@
     
-assertEquals(%22Hello, World!%5Cn%22
+StringWriter sw = new StringWriter();%0A            PrintWriter pw = new PrintWriter(sw);%0A            pw.println(%22Hello, World!%22);%0A            pw.close();%0A%0A            assertEquals(sw.toString()
 , ou

Fix java modules sample on Windows