This requirement is still not satisfied.
package com.codegym.task.task32.task3203;
import java.io.PrintWriter;
import java.io.StringWriter;
public class Solution {
public static void main(String[] args) {
String text = getStackTrace(new IndexOutOfBoundsException("fff"));
System.out.println(text);
}
public static String getStackTrace(Throwable throwable) {
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
throwable.printStackTrace(printWriter);
String s = writer.getBuffer().toString();
return s;
}
}