Here you can find the source of saveTreeStructuredGroupList(ArrayList
public static <T> void saveTreeStructuredGroupList(ArrayList<ArrayList<T>> treeStructuredGroupList, String filePath)
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; public class Main { public static <T> void saveTreeStructuredGroupList(ArrayList<ArrayList<T>> treeStructuredGroupList, String filePath) {/*from w w w. ja v a 2 s. c o m*/ PrintWriter pw = null; try { pw = new PrintWriter(new BufferedWriter(new FileWriter(filePath)), true); } catch (IOException e) { e.printStackTrace(); System.exit(1); } for (ArrayList<T> list : treeStructuredGroupList) { StringBuilder sb = new StringBuilder(10); for (T element : list) { sb.append(element); sb.append("\t"); } pw.println(sb.toString().trim()); } pw.close(); } public static void exit(int status) { System.exit(status); } }