code: public static String getStackTrace(Throwable throwable) {
      String stackTraceValue = null;
  
      if (throwable != null) {
        StringWriter writer = new StringWriter();
        throwable.printStackTrace(new PrintWriter(writer));
        stackTraceValue = writer.toString();
      }
  
      return stackTraceValue;
    }
docs: Returns the Stack Trace of the given {@link Throwable} object as a {@link String}.  Returns {@literal null}
  if the given {@link Throwable} object reference is {@literal null}.
  
  @param throwable {@link Throwable} object who's Stack Trace is returned.
  @return the Stack Trace of the given {@link Throwable} object as a {@link String}.
  @see java.lang.Throwable#printStackTrace(java.io.PrintWriter)