public static void replaceSystemOut(){
  final ThreadPrintStream threadStdOut=new ThreadPrintStream();
  System.setOut(threadStdOut);
  System.setErr(threadStdOut);
  threadStdOut.setThreadOut(stdout);
}

public static void replaceSystemOut ( ) { final ThreadPrintStream threadStdOut = new ThreadPrintStream ( ) ; System . setOut ( threadStdOut ) ; System . setErr ( threadStdOut ) ; threadStdOut . setThreadOut ( stdout ) ; }
changes system . out to a threadprintstream which will send output to a separate file for each thread .
