code: public static String getStackTrace(Throwable t, String separator) {
  
          Throwable cause = t;
          String result = "";
          while (cause != null) {
              result += getStackTraceAsString(cause.getStackTrace(), separator);
              cause = cause.getCause();
          }
          return result;
      }
docs: Returns the stack trace of the Throwable as a string.<p>
  
  @param t the Throwable for which the stack trace should be returned
  @param separator the separator between the lines of the stack trace
  
  @return a string representing a stack trace