code: public void setErr(PrintStream err) {
      this.err = err;
      if (!(System.err instanceof ThreadLocalPrintStream)) {
        throw new IllegalStateException("System.err should be set by nailgun.");
      }
      ThreadLocalPrintStream tls = (ThreadLocalPrintStream) System.err;
      tls.init(err);
    }
docs: Sets the current {@link PrintStream} for standard error for the current nail.
  
  @param err The {@link PrintStream} to use as stderr for the current nail. This should be a
  PrintStream that ultimately writes to {@link NGOutputStream}.