public static String toString(final StackTraceElement[] stackTrace) {
    Preconditions.checkNotNull(stackTrace, "Invalid stack trace");

    final StringBuilder sb = new StringBuilder();

    for (final StackTraceElement stackTraceElement : stackTrace) {
      sb.append(stackTraceElement.toString());
      sb.append(System.getProperty("line.separator"));
    }

    return sb.toString();
  }
Converts a stack trace to a string.

@param stackTrace The stack trace in question.
@return The converted stack trace.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/StackTrace.java