public static void muteCurrentOutAndErrStream(){
  if (alreadyMuted) {
    return;
  }
  ByteArrayOutputStream byteStream=new ByteArrayOutputStream();
  PrintStream outStream=new PrintStream(byteStream);
  latestOut=System.out;
  latestErr=System.err;
  System.setOut(outStream);
  System.setErr(outStream);
  alreadyMuted=true;
}

public static void muteCurrentOutAndErrStream ( ) { if ( alreadyMuted ) { return ; } ByteArrayOutputStream byteStream = new ByteArrayOutputStream ( ) ; PrintStream outStream = new PrintStream ( byteStream ) ; latestOut = System . out ; latestErr = System . err ; System . setOut ( outStream ) ; System . setErr ( outStream ) ; alreadyMuted = true ; }
redirect current system . out and system . err to a buffer
