class SettingsBuildingException extends Exception {

    private final List<SettingsProblem> problems;

    /**
     * Creates a new exception with the specified problems.
     *
     * @param problems The problems that cause this exception, may be {@code null}.
     */
    public SettingsBuildingException(List<SettingsProblem> problems) {
        super(toMessage(problems));

        this.problems = new ArrayList<>();
        if (problems != null) {
            this.problems.addAll(problems);
        }
    }

    /**
     * Gets the problems that caused this exception.
     *
     * @return The problems that caused this exception, never {@code null}.
     */
    public List<SettingsProblem> getProblems() {
        return problems;
    }

    private static String toMessage(List<SettingsProblem> problems) {<FILL_FUNCTION_BODY>}
}

        StringWriter buffer = new StringWriter(1024);

        PrintWriter writer = new PrintWriter(buffer);

        writer.print(problems.size());
        writer.print((problems.size() == 1) ? " problem was " : " problems were ");
        writer.print("encountered while building the effective settings");
        writer.println();

        for (SettingsProblem problem : problems) {
            writer.print("[");
            writer.print(problem.getSeverity());
            writer.print("] ");
            writer.print(problem.getMessage());
            String location = problem.getLocation();
            if (!location.isEmpty()) {
                writer.print(" @ ");
                writer.println(location);
            }
        }

        return buffer.toString();
    
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.Throwable) ,public void <init>(java.lang.String, java.lang.Throwable) <variables>static final long serialVersionUID