public static synchronized GridTestPrintStream acquireErr(){
  if (testErr == null)   testErr=new GridTestPrintStream(sysErr);
  if (errCnt == 0)   System.setErr(testErr);
  errCnt++;
  return testErr;
}

public static synchronized GridTestPrintStream acquireErr ( ) { if ( testErr == null ) testErr = new GridTestPrintStream ( sysErr ) ; if ( errCnt == 0 ) System . setErr ( testErr ) ; errCnt ++ ; return testErr ; }
acquires output stream for logging errors in tests .
