code: public void printStackTrace(PrintStream printStream) {
      if (mStackTrace == null) {
        printStream.print(getMessage());
      }
      else {
        printStream.print(mStackTrace);
      }
    }
docs: Simulates a printing of a stack trace by printing the string
  stack trace