question: 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 ; }
target:  Redirect current System.out and System.err to a buffer