https://coderanch.com/t/278299/java/Writing-output-console-file-system
File file = new File("test.txt");
FileOutputStream fis = new FileOutputStream(file);
PrintStream out = new PrintStream(fis);
System.setOut(out);
System.out.println("First Line");
System.out.println("Second Line");
System.out.println("Third Line");
System.out.println("Fourth Line");