public static <T> List<List<String>> splitList(List<String> list, int n) {
List<List<String>> strinList = new ArrayList<>();
if (list == null) return strinList;
int size = list.size();
int quotient = size / n; // 商数
int remainder = size % n; // 余数
int offset = 0; // 偏移
int len = quotient > 0 ? n : remainder; // 循环长度
int start = 0; // 开始下标
int end = 0; // 结束下标
List<String> list2 = null;
for (int i = 0; i < len; i++) {
if (remainder != 0) {
remainder--;
offset = 1;
} else {
offset = 0;
}
end = start + quotient + offset;
list2 = list.subList(start, end);
start = end;
strinList.add(list2);
}
return strinList;
}