How to change to a stringbuilder in java : I am trying to change the following code to stringbuilder so i can format the output of an arraylist  how can i do this.


 private static String createFormattedList(List<List<String>> failureList) {

        String lineBreak = "</br>";
        String result = "";
        for (List<String> failure : failureList) {

            for (String item : failure) {
                result += item + lineBreak;
            }
            result += lineBreak;

        }

        return result;
    }

    }